♠ Posted by uvesh in insert data
Insert Data in Sql server 2012
protected void InsertBtn_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection(@"Data Source=Home\SQLExpress;Initial Catalog=MyDatabase;Integrated Security=True");
SqlCommand insert = new SqlCommand("insert into tblUser(Uid, Name, Mobile, Email) values(@uid, @name, @mobile, @Email)", conn);
//SqlCommand insert = new SqlCommand("insert into tblUser values('"+1+"','"+Name.Text+"','"+Mobile.Text+"','"+Email.Text+"')",conn);
insert.Parameters.AddWithValue("@uid", 1);
insert.Parameters.AddWithValue("@name", Name.Text);
insert.Parameters.AddWithValue("@mobile", Mobile.Text);
insert.Parameters.AddWithValue("@Email",...