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

How can we load multiple tables in a dataset?

1102


How is entity framework different from ado.net?

909


What is the significance of CommandBehavior.CloseConnection ?

1106


Define executenonquery?

870


What is the role of data provider in ado.net?

948


What does executequery return?

911


What is datasource in ado.net?

1029


What is ado.net in vb net?

881


What we do with the object of ado.net dataset after using it?

964


Do we use stored procedure in ADO.Net?

946


What is execute reader in ado.net?

912


Does executenonquery return a value?

894


Which namespaces are used for data access?

1136


Explain the difference in record set and dataset?

891


What is ado asp?

956