• +91 9723535972
  • info@interviewmaterial.com

Ado.net Interview Questions and Answers

Question - Explain the ExecuteScalar method in ADO.NET?

Answer -

The ExecuteScalar Method in SqlCommandObject returns the first column of the first row after executing the query against the Data Source.

  • If the result set contain more than one column or rows, it takes only the first column of the first row. All other values are ignored.
  • If the result set is empty it will return null.
Int32 TotalSalary = Convert.ToInt32(cmd.ExecuteScalar());

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners