what is execute scalar?
Answers were Sorted based on User's Feedback
Answer / thirushakar
Scalar will return only one value.
(ie we can read or write only one data at the time)
| Is This Answer Correct ? | 33 Yes | 11 No |
Answer / versha
When we want any aggreagate answer then we use execute
scaler examples like avg,sum etc
this return one row and one column
| Is This Answer Correct ? | 24 Yes | 2 No |
Answer / muthu kumar
when we want to retrieve data that has single value then we
can prefer to execute scalar.
| Is This Answer Correct ? | 13 Yes | 4 No |
Answer / prabhat saxena
execute scalar return a object type value, by defalut it
will return first row of fst column value, mostly we used
it with aggregate function like sum(),max(),min(),avg()....
| Is This Answer Correct ? | 13 Yes | 4 No |
Answer / tonny
Executes the query, and returns the first column of the
first row in the result set returned by the query.
Additional columns or rows are ignored.
| Is This Answer Correct ? | 7 Yes | 2 No |
Answer / 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 |
Answer / usha
This method is used to execute commands that return single
value rather than resultset.
| Is This Answer Correct ? | 10 Yes | 6 No |
Answer / adsd
scalar will returns single value.scalar eg like avg,sum etc
it vl return oly one column as output
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / vivek kumar
execute scalar method return only one value that means you
can use this with max, min, sum function
| Is This Answer Correct ? | 3 Yes | 1 No |
Is entity framework better than ado.net?
About ADO and its objects ?
What is the current version of entity framework?
What are the ado.net connection pooling parameters?
What is the DataTableCollection?
Which database is the ado.net?
Which namespaces are used for data access?
0 Answers SwanSoft Technologies,
What are the essential features of ado.net?
Explain the ADO . Net Architecture ?
how you will deal result set? How do you sort a dataset?If a dataset contains 100 rows, how to fetch rows between 5 and 15 only?
What are the data providers used in ado.net
What does sqldatareader return?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)