Delete a row

If you want to delete a row from database, just load the row and then tell the data context to delete the row. Row will be deleted when changes to the data context are submitted back.
using (var ctx = SqlDataContext.CreateContext()) {
    Customer cu = ctx.Load<Customer>(query => query.CustomerID = 1);

Next chapter: Define generated properties

Last edited Oct 26, 2010 at 8:51 AM by nolics, version 2


No comments yet.