Quantcast
Viewing all articles
Browse latest Browse all 38

How to Check for error in LINQ to SQL on calling SubmitChanges ?

Below is a sample code demonstrating how to check for error in LINQ to SQL on calling SubmitChanges in C#.

How to Check for error in LINQ to SQL on calling SubmitChanges ?

using (GinktageContext context = new GinktageContext())
{
    StringWriter str = new StringWriter();
    context.Log = str;
    // Call function that invokes SaveChanges()
    AddBlockbusterTamilMovies();
    var data = sw.ToString();
    Console.WriteLine(data);
}

The post How to Check for error in LINQ to SQL on calling SubmitChanges ? appeared first on TechBlog.


Viewing all articles
Browse latest Browse all 38

Trending Articles