what is execute scalar?
Answer Posted / yograj pandey
Use the ExecuteScalar method to retrieve a single value (for example, an aggregate value) from a database. This requires less code than using the ExecuteReader method, and then performing the operations that you need to generate the single value using the data returned by a SqlDataReader.
A typical ExecuteScalar query can be formatted as in the following C# example:
cmd.CommandText = "SELECT COUNT(*) FROM dbo.region";
Int32 count = (Int32) cmd.ExecuteScalar();
| Is This Answer Correct ? | 6 Yes | 1 No |
Post New Answer View All Answers
What is difference between datagridview and datagrid control in winforms?
If a table contains 20000 records. In a page at each time 100 records to be displayed.
What are the rules to implement connection pooling?
What is ole access?
What is the use of adodc?
Which method in OLEDBAdapter is used to populate dataset with records?
Explain how to create dynamic gridview?
How can we load multiple tables in to dataset?
What is an ado connection?
Is bulk insert faster than insert?
What is difference between ado.net and asp net?
How to add an aggregate column?
What is a dataview?
What are the Data providers in ADO.Net?
What is ado recordset?