Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
Node is saved as draft in My Content >> Draft
  • DLINQ

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 34
    Comment on it

    Database Language Integrated Query or LINQ with Database is known as DLINQ.

     

    Mainly used when we want to manipulate data from the database.

     

    LINQ to SQL Statements

     

    Data Context

    Mapping of all entities and mainly tables entries to the database are provided by data context. Or we can say that, The association of the entities used in the project and for the database resides in the data context.
     It is like an interface that the query is written by the user and executed into the database. The Data context is like a buffer that will manipulate the database entities

     

    Example: A Simple Select
    
    
    This is an example of a very simple LINQ to SQL statement:
    
    
    public void SimpleQuery()
    
    {
    
        DataClasses1DataContext dc = new DataClasses1DataContext();
    
    
    
        var q =
    
            from a in dc.GetTable<Order>()
    
            select a;
    
    
    
        dataGridView1.DataSource = q;
    
    }
    

     

    In the example, an instance of the data context is created and after then a query is formed to get all of the values in the table; once the query runs, the result is used as the data source of a DataGridView control and the results are displayed in the grid:

     

    var q =
    
            from a in dc.GetTable<Order>()
    
            select a;
    
    .net

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: