Monday, January 31, 2011

ExecuteScalar()

Introduction


We can use ExecuteScalar() method, if we have to retrieve a single value from a database. It executes the query and returns the first column of the first row in the result set returned by the query. Additional rows and columns are simply discarded. It returns a maximum of 2033 characters. It is better to get the result of MAX,MIN,COUNT, etc using ExecuteScalar() method.

http://www.dotnetfunda.com/articles/article1147-how-to-use-executescalar-method-.aspx 

No comments:

Post a Comment