Insert data into database in c# .net
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Connection string");
con.Open();
SqlCommand cmd=new SqlCommand("Insert into table1 values('"+TextBox1.text+"','"++"')",con);
cmd.ExecuteNonQuery();
con.Close();
}
thank you
ReplyDelete