Inserting data with 2 Primary keys
Posted: Fri 02 Oct 2009 21:00
hi, i have a problem when inserting with a data to an oracle table having 2 primary keys.
i'm using Entity Developer for dotConnect to generate Devart LINQ to SQL Model. and Visual Studio 2008
here's my case:
the table:
-----------------------
MyTable
-----------------------
pk1 varchar2(50) //primary key
pk2 varchar2(50) //primary key
Content CLOB
Data BLOB
----------------
the code:
----------------
MyTableDataContext _context = new MyTableDataContext();
MyTable _entity = new MyTable();
_entity.pk1 = "key1";
_entity.pk2 = "key2";
//i do not give value to the other fields and i don't think thats the cause for the problem i have
_context.MyTables.InsertOnSubmit(_entity);
_context.SubmitChanges();
now after i run the code, i get an exception of System.InvalidOperationException : Sequence contains no matching element on _context.MyTables.InsertOnSubmit(_entity);
i wonder what is wrong with my code? the code runs perfectly with tables with 1 primary key.
anyone could help?
i'm using Entity Developer for dotConnect to generate Devart LINQ to SQL Model. and Visual Studio 2008
here's my case:
the table:
-----------------------
MyTable
-----------------------
pk1 varchar2(50) //primary key
pk2 varchar2(50) //primary key
Content CLOB
Data BLOB
----------------
the code:
----------------
MyTableDataContext _context = new MyTableDataContext();
MyTable _entity = new MyTable();
_entity.pk1 = "key1";
_entity.pk2 = "key2";
//i do not give value to the other fields and i don't think thats the cause for the problem i have
_context.MyTables.InsertOnSubmit(_entity);
_context.SubmitChanges();
now after i run the code, i get an exception of System.InvalidOperationException : Sequence contains no matching element on _context.MyTables.InsertOnSubmit(_entity);
i wonder what is wrong with my code? the code runs perfectly with tables with 1 primary key.
anyone could help?