Hi. I'm using LINQ to SQL. I wanna create a database with LINQ but the following exception has occurred : Illegal characters in path.
This is my code :
public static string DBFolder = Application.StartupPath + "\\SQL\\";
private void MainForm_Load(object sender, EventArgs e)
{
if (!Directory.Exists(StaticVariables.DBFolder))
Directory.CreateDirectory(StaticVariables.DBFolder);
using (RezaRestaurant.SQL.DataClasses1DataContext dbc = new RezaRestaurant.SQL.DataClasses1DataContext())
{
if (!File.Exists(StaticVariables.DBFolder + dbc.Mapping.DatabaseName + ".mdf") && !dbc.DatabaseExists())
{
RezaRestaurant.SQL.DataClasses1DataContext db = new RezaRestaurant.SQL.DataClasses1DataContext(StaticVariables.DBFolder + dbc.Mapping.DatabaseName + ".mdf", dbc.Mapping.MappingSource);
db.CreateDatabase();//Exception
}
}
}
BTW : I was using UFT8 characters in database's tables, like this : اقلام_فروخته_شده
Could you please guide me ? Thanks.