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
Which is faster entity framework or ado.net?
Describe ado.net object model in detail.
What is execute scalar in ado.net?
Can we connect two dataadapters to same data source using single connection at same time?
What is ado.net and its architecture?
What is the meaning of executenonquery?
Explain the difference between data reader and data adapter?
What is the usage of the dataset object in ado.net?
What is the difference between Command and CommandBuilder object?
How would you connect to a database by using .NET?
How do you find the count of records in a dataset?
how to create a quiz software using 4 options to answer and how to check with answers in the database and award marks....
What is ado.net connection?
What are the data access namespaces in .NET?
What are disadvantages of microsoft-provided data provider classes in ado.net?