Node is saved as draft in My Content >> Draft
-
Exceute NonQuery in ADO.NET
While working with ADO.NET you need to understand the thing why SqlCommand is used.
We have two kind of operations related to database:
1 That will make changes in the database
2 That will not make any change to the database
Execute no query is the method of SqlCommand class and it used where we want to alter database values.
string connetionString = null;
SqlConnection cnn ;
SqlCommand cmd ;
string sql = null;
connetionString = "Data Source=ServerName;Initial Catalog=DatabaseName;User ID=UserName;Password=Password";
sql = "Your SQL Statemnt Here";
cnn = new SqlConnection(connetionString);
try
{
cnn.Open();
cmd = new SqlCommand(sql, cnn);
cmd.ExecuteNonQuery();
cmd.Dispose();
cnn.Close();
MessageBox.Show (" ExecuteNonQuery in SqlCommand executed !!");
}
catch (Exception ex)
{
MessageBox.Show("Can not open connection ! ");
}

0 Comment(s)