Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are the advantages and drawbacks of using ado.net?

1041


What is connection in ado.net?

889


What is the difference in record set and dataset?

974


What are the different row versions available in table?

909


How do you merge 2 datasets into the third dataset in a simple manner?

946


Which database is the ado.net?

913


What is ado.net and its architecture?

1072


how to create a quiz software using 4 options to answer and how to check with answers in the database and award marks....

4358


Explain the various objects in dataset.

934


what is the difference betwen typed dataset and untyped dataset?in general which dataset can we use in programming?

945


If a table contains 20000 records . In a page at each time 100 records to be displayed what are the steps you will take to improve performance? Will you use dataset or datareader?

1003


What are the advantage of ado.net?

931


List all the steps in order, to access a database through ado.net?

1026


What is the difference between ado.net and entity framework?

986


What is connection string?

954