Results 1 to 2 of 2

Thread: What is data context class? Explain its role?

  1. #1
    Join Date
    Aug 2015

    What is data context class? Explain its role?

    Data context class is a LINQ to SQL class that acts as a medium between a SQL server database and LINQ to SQL entities classes mapped to that database. It has following responsibilities:

    1. Contains the connection string information, methods to connect to the database and manipulating the data in the database.
    2. Contains several methods that send updated data from LINQ to SQL entity classes to the database.
    3. Methods can also be mapped to stored procedures and functions.
    4. With data context, we can perform select, insert, update and delete operations over the data in the database.

    Hair Building Fiber
    Step Up Height Increaser

  2. #2
    Join Date
    Jul 2015
    The DataContext is the source of all entities mapped over a database connection. It tracks changes that you made to all retrieved entities and maintains an "identity cache" that guarantees that entities retrieved more than one time are represented by using the same object instance.

    In general, a DataContext instance is designed to last for one "unit of work" however your application defines that term. A DataContext is lightweight and is not expensive to create. A typical LINQ to SQL application creates DataContext instances at method scope or as a member of short-lived classes that represent a logical set of related database operations.

    Best Orthodontist in Delhi | Dentist in Delhi
    Last edited by Kiran674; 03-28-2016 at 05:57 AM.

Similar Threads

  1. Replies: 0
    Last Post: 03-07-2014, 03:50 PM
  2. jQuery mobile: difference between data-role and role/class
    By Yuvan in forum Web Technology basics
    Replies: 0
    Last Post: 02-15-2014, 02:31 AM
  3. Java - Please explain me the role of seed in class Random in java.util
    By Bandhavi in forum Programming languages basics
    Replies: 0
    Last Post: 01-21-2014, 03:40 AM
  4. Replies: 0
    Last Post: 01-18-2014, 01:30 PM
  5. Replies: 0
    Last Post: 10-18-2013, 10:50 AM

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts