Switch to full style
You can find discussions, solutions and codes related to ASP.NET
Post a reply

hi need a answer

Mon Jun 15, 2009 8:53 am

hi friends having one doubt in asp.net so pls if you can help me


What is the purpose of Execute scalar method of Command object ?



Re: hi need a answer

Fri Jun 19, 2009 3:56 am

ExecuteScalar method is to retrieve a single value, for example, an aggregate value, from a data source. This requires less code than using the ExecuteReader method, and then performing the operations that are required to generate the single value using the data returned by an OleDbDataReader.

It only Executes the query, and returns the first column of the first row in the resultset returned by the query. Extra columns or rows are ignored.

Post a reply