Joined: Mon Jun 15, 2009 8:39 am Posts: 1 Has thanked: 0 time Have thanks: 0 time
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 ?
Bluerose
Question subject: Re: hi need a answer
Posted: Fri Jun 19, 2009 3:56 am
Joined: Fri Mar 20, 2009 4:03 am Posts: 21 Location: Indonesia Has thanked: 0 time Have thanks: 0 time
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.