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
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
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.