Monday, 24 September 2012

ExecuteReader ExecuteNonQuery ExecuteScalar Examples in Asp.NET when to use what to use in C#.NET,VB.NET


Introduction:

In this article I will explain executereader executenonquery executescalar examples when to use what in asp.net using C#.net and VB.NET.

Description:

If you want to know which command object needs to be used in different situations for that you need to check this article

Differences between ExecuteNonQuery, ExecuteReader and ExecuteScalar in asp.net

If you want to know about each sqlcommand object check below articles

ExecuteNonQuery

ExecuteNonQuery method will return number of rows effected with INSERT, DELETE or UPDATE operations. For more details check this article

ExecuteNonQuery Example in asp.net using C#, VB.NET

ExecuteScalar

Execute Scalar will return first row first column value i.e. it will return single value and ignore other values on execution of SQL Query or Stored procedure using command object.
For more details check this article

ExecuteScalar Example in asp.net using C#, VB.NET

ExecuteReader

Execute Reader will be used to return the set of rows, on execution of SQL Query or Stored procedure using command object. For more details check this article

ExecuteReader Example in asp.net using C#, VB.NET

No comments:

Post a Comment