SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=E:\\Database3.mdf;Integrated Security=True;Connect Timeout=30"); con.Open(); SqlCommand cmd = new SqlCommand(@"insert into tbl_insert values(@Id,@name,@city)", con); cmd.Parameters.AddWithValue("@Id", Convert.ToInt32(txtId.Text)); cmd.Parameters.AddWithValue("@name", txtName.Text); cmd.Parameters.AddWithValue("@city", txtCity.Text);
cmd.ExecuteNonQuery();
<pre>command.ExecuteNonQuery();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)