Monday

linq transactions support/Charp/dot.net 3.5

 [Test]
public void StoredProcedure_and_LinqUpdates_Test()
{

// dx is datacontext instance
dx.Connection.Open();
dx.Transaction = dx.Connection.BeginTransaction();


// calling stored procedure from linq here
var result = dx.PaymentServices_ApplyPaymentToAccount(89);


// updating objects from context
Invoice i = customerService.getInvoice(277);

i.DueDate = Convert.ToDateTime("11/5/2008");

// submitting changes and committing transaction
dx.SubmitChanges();
dx.Transaction.Commit();


// rollback transactions and
// no changes made in object or by stored procedure will be stored
dx.Transaction.Rollback();

}

more...

No comments:

imagemagic add text to image

rem different types of text annotations on existing images rem cyan yellow orange gold rem -gravity SouthWest rem draw text and anno...