Sudhir Goswami
What is Execute Non Query?
By Sudhir Goswami in ADO.NET on Jul 01 2013
  • Keerthi Venkatesan
    Apr, 2016 1

    ExecuteNonQuery used for executing queries that does not return any data. It is used to execute the sql statements like update, insert, delete etc. ExecuteNonQuery executes the command and returns the number of rows affected.

    • 2
  • Bharathi Raja
    Jan, 2018 20

    ##will work with Action Queries only (Create,Alter,Drop,Insert,Update,Delete). ##Returns the count of rows effected by the Query. ##Return type is int ##Return value is optional and can be assigned to an integer variable.

    • 1
  • bharat aggarwal
    Oct, 2015 16

    ExecuteNonQuery is typically used for SQL statements without results (e.g., UPDATE, INSERT, etc.).

    • 1
  • Srinivas Pabballa
    Aug, 2015 28

    ExecuteNonQuery() is a predefined member method of Command Class.which is used to execute backend commands when the connection is opened with the central database such as executing the Sqlcommands from the .cs code

    • 0
  • Ghanshyam Gondhare
    Jul, 2015 9

    if we perform any changes on database data.............use executenonquery()

    • 0
  • Rahul Prajapat
    May, 2015 26

    Executenonquery() is used to perform any ddl or dml task

    • 0
  • sajidlkhan lodi
    Feb, 2015 10

    ExecuteNonQuery() used for Insert,Update,Delete Statements

    • 0
  • Munesh Sharma
    Apr, 2014 12

    The ExecuteNonQuery() performs Data Definition tasks as well as Data Manipulation tasks also. The Data Definition tasks like creating Stored Procedures ,Views etc. perform by the ExecuteNonQuery() . Also Data Manipulation tasks like Insert , Update , Delete etc. also perform by the ExecuteNonQuery() of SqlCommand Object.Although the ExecuteNonQuery returns no rows, any output parameters or return values mapped to parameters are populated with data.The following ASP.NET program insert a new row in Discount (Pubs database) table using ExecuteNonQuery();

    • 0
  • Naitik  Jani
    Apr, 2014 10

    ExecuteNonQuery() is used to define number of records affected. you can use it for Insert,Update,Delete functionality.

    • 0
  • Pramod Lawate
    Aug, 2013 26

    Execute Non Query is ADO.Net Object it is used for execute SQL Statement for Insert,Update Delete, and it does not return any value

    • 0
  • Abhineet Srivastava
    Jul, 2013 18

    It is use to excute the command which returns no record like our insert,update and delete opration.

    • 0
  • Naeem Khan
    Jul, 2013 1

    Hello friend,Executes a Transact-SQL statement against the connection and returns the number of rows affected.You can use the ExecuteNonQuery to perform catalog operations (for example, querying the structure of a database or creating database objects such as tables), or to change the data in a database without using a DataSet by executing UPDATE, INSERT, or DELETE statements. Although the ExecuteNonQuery returns no rows, any output parameters or return values mapped to parameters are populated with data. For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command. When a trigger exists on a table being inserted or updated, the return value includes the number of rows affected by both the insert or update operation and the number of rows affected by the trigger or triggers. For all other types of statements, the return value is -1. If a rollback occurs, the return value is also -1.

    • 0

Most Popular Job Functions


MOST LIKED QUESTIONS