Sanjeev Singh
What is the difference between excute query and excute nonquery.?
By Sanjeev Singh in SQL Server on Feb 20 2009
  • Vijaya Kadiyala
    Feb, 2009 20

     

    executeQuery() is for command objects i.e., this method will send "select statement" to database and returns value given by the database.

    Moreover the executeQuery() is not used in .net but it is used in JAVA.

    executeNonQuery() uses the "Insert/Update/Delete/Stored subprogram"  , this method will return number of records effected by the database table

    • 0
  • Jitendra  Narala
    Feb, 2009 20

    We have ExecuteNonQuery and ExecuteReader(not ExecuteQuery)

    ExecuteNonQuery:  Executes Insert, Update, and Delete statements (DML statements) and returns the number of rows affected.

    ExecuteReader: Executes the SQL query (Select statement) and returns a Reader object which can perform a forward only traversal across the set of records being fetched.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS