SqlCommand comm = new SqlCommand("INSERT INTO desg VALUES (@txtsno, @txtdesg, @txtbasic)", connection);
your_db.Open();
try {
comm.Parameters.AddWithValue("@txtsno", txtsno.Text.Trim());
comm.Parameters.AddWithValue("@txtdesg", txtdesg.Text.Trim());
comm.Parameters.AddWithValue("@txtbasic", txtbasic.Text.Trim());
comm.ExecuteNonQuery();
comm.Dispose();
comm = null;
}
catch(Exception ex)
{
throw new Exception(ex.ToString(), ex);
}
finally
{
your_db.Close();
}
hello
asp.net c#,sql server,use sqlhelper class, funcation,class,store procedure,view,triggers,call email class in asp.net c#,MVC AND ENTITY FRAMEWORK TUTORIAL,how to create database with script using c#,datareader with sqlhelper and run time label bind in grid,insert update select storprocedure Delete duplicate record in database,Delete duplicate record in database,how add connection string,how add connection string
Monday, 22 October 2012
Parameteris Query in c#
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment