Hi all,
I'm currently trying out the LINQ to SQLite and Entitiy Framework stuff in C#, and it seems to fit my needs perfectly. However, I'm having trouble inserting new rows into my tables.
I created a test table via the sqlite3 command line tool using this SQL string: "CREATE TABLE Test ( a INT, b INT, PRIMARY KEY (a) );" After generating the edmx, I tried this code to insert a row:
db = new testEntities();
Test x = new Test();
x.a = 2; x.b = 3;
db.AddToTest(x);
db.SaveChanges();
The last statement always throws a System.Data.OptimisticConcurrencyException and no rows are actually inserted. I can view data from the table just fine, using the LINQ query "from t in db.Test select t;". It's just SaveChanges() that doesn't work.
I compiled and ran the testlinq test suite from the source distribution and it worked. Also, I can insert rows into northwind.db in my own code. So did I maybe create my db file the wrong way?
Any help you be appreciated :)