What is the difference b/w ExecuteReader, ExecuteScalar & ExecuteNonQuery. And what they return.
By in ASP.NET on Feb 26 2007
  • preetam sharma
    Mar, 2007 1

    Executereader  :-is used with read  Method and it will read the query and fill that in a dataset.we  use it in  datareader.

    Execute Scalar:-is used when you want a single output.It is used with Return Value.

    ExecuteNonQuery:-This Function is Used When you want to update your query it does not perform any aoperation like:-update,deletion,insert.It is used with Perform Action.

    • 0
  • raj beniwal
    Feb, 2007 27

    ExcecuteReader : this method should be used when you want to execute a row returning commant, such as SELECT statement.

    ExecuteScaler : you should use this method when you only want the first column of the first row of the result set runtime.

    ExecuteNonQuery : use this method when you want to execute non row returning command such as DELETE statement.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS