Datacontext submitchanges not updating database My cam free live chat filipina in u a e
In Use is a bit field) For some reason it isn't working. It's as if the The table could not be updated properly because it had no primary key. Other tables seem to work fine but I've compared properties in the and they all match.HI Experts I have the following table in DB: CREATE TABLE [dbo].[vdc_options]( [option_id] [int] IDENTITY(0,1) NOT NULL, [option_name] [nvarchar](50) COLLATE Hebrew_CI_AS NOT NULL, [option_value] [nvarchar](50) COLLATE Hebrew_CI_AS NOT NULL) Where option_name is defined as the primary key of this table I have defined the following table in my c# class [Table] private class vdc_options and now , I am trying to update some of the values (and I have checked that there are changes) No Exception is thrown , and the updated values are not saved to the database. Thanks Hi elimesika; In order to update a database the table def needs to indicate which column is the primary key.As you stated in the question that the column option_name is the primary key make the following change to the column attribute.Descendants("location") select lc; //for each location, write data to database Location Data Context location Data = new Location Data Context(); foreach (var location Xml Element in locations Xml Data) This is old but thought i will come and clear this up. Whenever your update or Submitchanges fails try puttin Insert On Submit() statment. 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.
You apply any number of updates, inserts or deletes.