ADO.NET ExecuteNonQuery in SqlCommand Object
ExecuteNonQuery() is one of the most frequently used method in SqlCommand Object and is used for executing statements that do not return result set. ExecuteNonQuery() performs Data Definition tasks as well as Data Manipulation tasks also. The Data Definition tasks like creating Stored Procedures and Views perform by ExecuteNonQuery() . Also Data Manipulation tasks like Insert , Update and Delete perform by ExecuteNonQuery().
The following example shows how to use the method ExecuteNonQuery() through SqlCommand Object.
connetionString = "Data Source = ServerName; Initial Catalog = DatabaseName; User ID = UserName; Password = Password"
sql = "Your SQL Statement Here"
You have to replace the string with your realtime variables.