26 December 2012

LINQ Hints

  LINQ -- Language INtegrate Query.
  It supporst all .Net Language.
LINQ -- Data Provider:

  1.    LINQ To Object
  2.   LINQ To ADO.NET
  3.   LINQ To XML


  •              LINQ To SQL.
  •              LINQ To Entity Framework.
  •              LINQ To Dataset.

Query Basics:
         Query Expression consists of set of Clauses written in a declarative Syntax similar to SQL /XQuery.
  Query must:

  •      Begin with from Clause.
  •      End with select/Group clause.
  •      Between one or more of following clauses using
  •              Where,Join,from orderby,let,into.

Aggragate Clause:
    Select ,Distinct,Order bymTake,Takewhile,skip,skipwhile,wheremjoinmgroupbymlet,into

Two ways to write LINQ Query:

  1.    Query syntax -- Use Query
  2.    Method Syntax -- Uses Lambda Expression.

Lambda Expression:
    => Goes into Separate Parameters from method body.

LINQ To Object:

  • Object supports either IEnumerable or Ienumerable<t>
  • Array,ArrayList,Collection,Generic Collection.
  • Using System.LINQ namespace.

  •     Using System.Data.LINQ namespace.
  •     Requires Entity  classes which you can build using the ORD.
  •     ORD-- Object Relational Designer.
  •     E-R data models will use for Other Database.

LINQ To Dataset:

  •       Collections of data from ADO.NET and Put into Dataset or DataTable.

No comments: