private void button1_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(); con.ConnectionString = "database=test;server=.\\sqlexpress;integrated security=true; user instance=true; user=user;password=passwd"; con.Open(); SqlCommand cmd=new SqlCommand(); cmd.Connection = con; cmd.CommandType=CommandType.Text; cmd.CommandText="insert into tbemp(Name,Address,Salary) values(@nm,@ad,@sal)"; cmd.Parameters.Add("@nm",SqlDbType.VarChar,50).Value=textBox1.Text; cmd.Parameters.Add("@ad",SqlDbType.VarChar,50).Value=textBox2.Text; cmd.Parameters.Add("@sal",SqlDbType.VarChar,50).Value=textBox3.Text; cmd.ExecuteNonQuery(); }
"user instance=true"
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)