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 is difference between datagridview and datagrid control in winforms?

1027


If a table contains 20000 records. In a page at each time 100 records to be displayed.

888


What are the rules to implement connection pooling?

1067


What is ole access?

946


What is the use of adodc?

988


Which method in OLEDBAdapter is used to populate dataset with records?

1023


Explain how to create dynamic gridview?

978


How can we load multiple tables in to dataset?

1086


What is an ado connection?

971


Is bulk insert faster than insert?

911


What is difference between ado.net and asp net?

1040


How to add an aggregate column?

1012


What is a dataview?

970


What are the Data providers in ADO.Net?

1017


What is ado recordset?

991