Hello: I am teaching myself Linq to Sql in C#. Because I am using a SqlCE database I had to use SqlMetal to generate the dbml file. This went fine, and I added the dbml file to my program. I can't find out how to generate a DataContext for the database, but I can query the database, but can not insert a row. Here is an example of what does not work:
Journal is the Database, Exercise is the only table in the database.
string con = Properties.Settings.Default.JournalConnectionString;
Journal db = new Journal(con);
Exercise ne = new Exercise();
ne.Date = Convert.ToDateTime("2009-10-25T14:35:00");
ne.Length = Convert.ToDouble(3.0);
ne.Elapsed = "00:53:35";
db.SubmitChanges();
Can someone suggest what I am doing wrong with the insert? Thank you very much.