C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
Java
Learn iOS Programming
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
12
Reply
What is Execute Non Query?
Sudhir Goswami
12y
71.2k
1
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
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.
Keerthi Venkatesan
9y
3
##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.
Bharathi Raja
7y
1
ExecuteNonQuery is typically used for SQL statements without results (e.g., UPDATE, INSERT, etc.).
bharat aggarwal
10y
1
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
Srinivas Pabballa
10y
0
if we perform any changes on database data.............use executenonquery()
Ghanshyam Gondhare
10y
0
Executenonquery() is used to perform any ddl or dml task
Rahul Prajapat
10y
0
ExecuteNonQuery() used for Insert,Update,Delete Statements
sajidlkhan lodi
10y
0
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();
Munesh Sharma
11y
0
ExecuteNonQuery() is used to define number of records affected. you can use it for Insert,Update,Delete functionality.
Naitik Jani
11y
0
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
Pramod Lawate
12y
0
It is use to excute the command which returns no record like our insert,update and delete opration.
Abhineet Srivastava
12y
0
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.
Naeem Khan
12y
0
Which namespaces are used for data access?
How do we use stored procedure in ADO.NET and how do we provide parameters to the stored procedures?
Message