Create a row

To create a row, you must first create a context. Then create new instance of an object (Customer) and insert it to the current context. Finally submit all changes for the context. This will create new row in the database for each inserted item.
using (var ctx = SqlDataContext.CreateContext()) {
    Customer cu = new Customer();
    ctx.Insert(cu);
    cu.CustomerName = "<customer name>";
    // Set all values to object
    ctx.SubmitChanges();
}

Modify a row

Last edited Oct 26, 2010 at 9:50 AM by nolics, version 4

Comments

No comments yet.