Tuesday 25 September 2012

What are the difference between ExecuteNonQuery , ExecuteReader and ExecuteScaler in ADO.NET

Hi friend,in this article i have explained what is the basic deifference between  ExecuteNonQuery , ExecuteReader and ExecuteScaler in ADO.NET.

ExecuteNonQuery:

ExecuteNonQuery method will return number of rows effected by INSERT,DELETEor UPDATE operations.ExecuteNonQuery method will be used only for insert,update,delete,and set staements;

ExecuteScaler :

ExecuteScalar method will return single row single column value i.e single value, on execution of sql query or stored procedure using command object.It is very fast to retrieve single values from database.

ExecuteReader :

ExecuteReader will be used to return the set of rows on execution of sql query or stored procedure using command object.This is used only forward retrieval of records and it is used to the table value from the first to last.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.