How to Deleting Data when using SqlCommand Object in ADO.Net?

How to Deleting Data when using SqlCommand Object in ADO.Net?

To deleting data also using the ExecuteNonQuery method.  The following example shows how to delete a record from a database with the ExecuteNonQuery method: 
1.Prepare command string
2.Instantiate a new command
 SqlCommand cmd = new SqlCommand();
3.Set the CommandText property
 cmd.CommandText = deleteString;
4.Set the Connection property
 cmd.Connection = conn;
5.Call ExecuteNonQuery to send command
 cmd.ExecuteNonQuery(); 

By:Aditya
Date:2028-10-10 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related ADO.NET Subjective Links

ADO.NET Subjective interview questions and answers for experienced and fresher