Subscribe Now!

Enter your email address:

Monday, March 7, 2011

What is the difference between Execute Scalar and Execute Reader?

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 NonQuery..
1.It will not return any data.
2.It is used with insert and update.
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.

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

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...