I would probably pass in the customer log as a parameter to the method and then have it deal with just the database insertion.
If you wanted to keep a Insert Or Update type of approach I would branch on perhaps something like the object ID if it has one.
A couple of problems I see in your approach: // a method higher up the chain void Create Customer Log() void Update Customer Log(string application No) Data_Customer_Log Get Customer Log(string application No) Data_Customer_Log Insert Or Update(Data_Customer_Log record) Data_Customer_Log Insert(Data_Customer_Log record) Data_Customer_Log Update(Data_Customer_Log record) I would probably point out that these methods would probably be in different classes.
When we defined our data model, the LINQ to SQL designer also created a custom Data Context class that provides the main conduit by which we'll query our database and apply updates/changes.
In the example data model we defined above this class was named "Northwind Data Context".
Hi all, I am new to Linq and want to update data in a table. I create datacontext also and values assign to it as well and in the last dc.
Submit Changes(); also code but updation does not perform.
You can accomplish this by adding/removing data objects from the Data Context's table collections, and by then calling the Submit Changes() method.