Linq to SQL - Default Insert/Update/Delete functions not present
Using VS2010 and SQL express 2005, Ive created a database, created a simple table, added the database to VS2010, dragged the table i wish to query into a new 'Linq To SQL开发者_JS百科' class.
Now, selecting works as expected - totally great.
However it has not generated the Remove() method, mydb.SumbitChanges()
does nothing after amending a retrieved object, so I have obviously missed a vital step.
I have not defined anything to do updating or removing, but assumed it did this 'out the box'.
Can anyone offer any insight?
Here is a link how you do insert, update and delete:
http://msdn.microsoft.com/de-de/library/bb386931.aspx
Resolved - I had not set a primary key on the table.
精彩评论