|
Sunday, December 11, 2011
Difference Between SQL Functions and Stored Procedure
Thursday, October 13, 2011
Difference between ASP.NET Web Service and WCF
"width: 284pt;" width="378">
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Saturday, August 27, 2011
LINQ to SQL
LINQ – Language integrated query
It’s allows the programmer to express query behavior in their programming language of choice. It provide type safety and compile time valuation of expression.
LINQ supports three data source objects, XML and databases.
LINQ to SQL allows to represent the database objects in .Net classes, you can query the database as well as update/delete/insert the data.
It supports views, stored procedure and transactions, allows the integration validation logic into data model.
DataContext Class
For each LINQ to SQL class, there will be custom datacontext class will be generated. Properties will be added for each table and stored procedure we added into LINQ to SQL design surface.Datacontext is main conduit from which we query our entities from database.
//Connnection to database.
AdventureWorksDataContext db = new AdventureWorksDataContext();
//Query the datamodel through query.
var query = from p in db.Products
select p;
//Result of query
this.grid.datasource = query;
//Update/insert/delete change into database.
db.SubmitChanges();
Summary
LINQ to SQL provides a nice, clean way to model the data layer of your application.Once you've defined your data model you can easily and efficiently perform queries, inserts, updates and deletes against it.
Wednesday, July 6, 2011
LINQ-Language INtegrated Query
LINQ-Language integrated Query, new language library which can be used to Query the Implementation of interface's IEnumerable, List, T[], HashSet.
Normally LINQ methods are supplied with Lambas expression, Anonymous methods and normal methods.
LINQ methods are classified into Different category.
Normally LINQ methods are supplied with Lambas expression, Anonymous methods and normal methods.
LINQ methods are classified into Different category.
- Chiaining – (Where, Select)
- Combine and Reduce – (Concat, Distinct, Union)
- First and Match – (First , FirstOrDefault)
- Other and Match – (Last, ElementAt, Single)
- Set – (Except, Intersect, Union)
- Membership and Count – (Contains, Count)
- Aggregate – (Sum, Avarage, Min, Max, Aggregate)
- Grouping – (GroupBy)
- Ordering – (OrderBy, OrderByDescending, ThenBy, ThenBydescending)
- Export – (ToArray, ToList, ToDictionary, ToLookup)
For more information on MSDN - http://msdn.microsoft.com/en-us/netframework/aa904594
Sunday, March 6, 2011
SQL Server 2008 Joins
Joining is basic functionality of SQL Server to get the results combine of more than one table. There are three types of joinings
1) CROSS JOIN
CROSS JOIN is Cartesian product of both table records.
i) SELF JOIN
SELF JOIN is Cartesian product of same table records.
2) INNER JOIN
INNER JOIN is Cartesian product + Filter predicate on ON
i) COMPOSITE JOIN
COMPOSITE JOIN is Cartesian product + Filter predicate on more than on attribute on joins tables
ii) NON-EQU JOIN
NON-EQU JOIN is Cartesian product + Filter predicate on ON with not equal operator
iii) MULTI TABLE JOIN
MULTI TABLE JOIN is Cartesian product + Filter predicate on ON with more than one table and joining applies from left to right direction.
3) OUTER JOIN
OUTER JOIN is Cartesian product + Filter predicate on ON + Add outer rows(Rows from preserved table)
i) LEFT OUTER JOIN
LEFT OUTER JOIN is Cartesian product + Filter predicate on ON + Add outer rows(Rows from LEFT preserved table)
ii) RIGHT OUTER JOIN
RIGHT OUTER JOIN is Cartesian product + Filter predicate on ON + Add outer rows(Rows from RIGHT preserved table)
iii) FULL OUTER JOIN
FULL OUTER JOIN is Cartesian product + Filter predicate on ON + Add outer rows(Rows from BOTH preserved table)
Write what you want to say about this article.
1) CROSS JOIN
CROSS JOIN is Cartesian product of both table records.
i) SELF JOIN
SELF JOIN is Cartesian product of same table records.
2) INNER JOIN
INNER JOIN is Cartesian product + Filter predicate on ON
i) COMPOSITE JOIN
COMPOSITE JOIN is Cartesian product + Filter predicate on more than on attribute on joins tables
ii) NON-EQU JOIN
NON-EQU JOIN is Cartesian product + Filter predicate on ON with not equal operator
iii) MULTI TABLE JOIN
MULTI TABLE JOIN is Cartesian product + Filter predicate on ON with more than one table and joining applies from left to right direction.
3) OUTER JOIN
OUTER JOIN is Cartesian product + Filter predicate on ON + Add outer rows(Rows from preserved table)
i) LEFT OUTER JOIN
LEFT OUTER JOIN is Cartesian product + Filter predicate on ON + Add outer rows(Rows from LEFT preserved table)
ii) RIGHT OUTER JOIN
RIGHT OUTER JOIN is Cartesian product + Filter predicate on ON + Add outer rows(Rows from RIGHT preserved table)
iii) FULL OUTER JOIN
FULL OUTER JOIN is Cartesian product + Filter predicate on ON + Add outer rows(Rows from BOTH preserved table)
Write what you want to say about this article.
Subscribe to:
Posts (Atom)