Wednesday, March 17, 2010

Difference between Execute Reader & XMLReader & NonQuery & Scaler & Query

Execute Reader..
1.Returns a datareader with data.
2.It is done by command object.
3.It is readonly.
4.It executes only select command.
5. This is known as a forward-only retrieval of records.It uses your sql statement to read through the table from the first to the last. 


Execute XMLReader..
1.
Returns the recordset as a XML document.
2. Just Like Reader other than this

Execute NonQuery..
1.It will not return any data.
2.It is used with insert ,update and delete.
3.It returns only the number of rows affected.

Execute Scaler..
1.It returns only one value.
2.That value will the first column first row value.

3.This is very light-weight and is perfect when all your query asks for is one item.
4.  Select Count(*) or with in group by function

Execute Query..
1.Its for command objects.
2.It returns the value given by database through select statement.


Useful Links:
www.nigelwhitworth.com

No comments:

Post a Comment