![]() |
| ||
| ExecuteRedear vs ExecuteScalar I am having confusion in ExecuteScalar & ExecuteReader If we use ExecuteReader for select with aggregate function, it will not give any error and run successfully so if we can do both queries select with aggregate & select with non aggregate with the help of only one method ExecuteReader so why is there ExecuteScalar………, is there any other benefit of it? Please give the proper answer |
| ||
| Re: ExecuteRedear vs ExecuteScalar The main difference is the "footprint" of the return value. ExecuteReader always returns an object, for example, a SqlDataReader. Then, to get the actual results, you have to do a Read(), then get the value. ExecuteScalar immediately returns the actual value. So, in terms of retrieving Scalar data from a database, ExecuteScalar is more efficient. |
| ||
| Re: ExecuteRedear vs ExecuteScalar Thanx...... Quote:
|
| All times are GMT -4. The time now is 11:47 pm. |
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC