Datacontext submitchanges not updating database
Once I added a new column and made a primary key than everything worked fine. This was my test table to i didnt have primary key.Dim db As New Northwnd("c:\northwnd.mdf") ' Make changes here. Submit Changes() Catch e As Change Conflict Exception Console. If override methods are present for insert, update, or delete, Submit Changes executes these methods instead of the default LINQ to SQL commands.Submit Changes starts a transaction and will roll back if an exception occurs while Submit Changes is executing.However, this does not roll back the changes in memory or tracked by the Data Context; those changes will need to be rolled back manually.You have made no changes to the actual data in the database.Your changes are not transmitted to the server until you explicitly call Submit Changes on the Data Context.
Parse(xml Result); //xml Result is the string containing the XML var locations Xml Data = from lc in result Data.
When I put a Insert On Submit(single) line than it gave me error that "data can not be inserted because table does not have Primary key".
Regardless of how many changes you make to your objects, changes are made only to in-memory replicas.
(Actually it had the column but the constraint was not copied when I did a SELECT INTO my dev table).
The Data Context class requires a primary key for updates.