Use It U will get the Result.
Just Copy and Paste.
SqlConnection cnn1 = new SqlConnection(@"Server=NGENIOUS-WSSDEV\SQLEXPRESS;Database=MIC;Trusted_Connection= True")
SqlCommand cmd1 = new SqlCommand("insert into orderdetails
(productcode,productname,productcatagory,quantity,spldiscount,units)
values(@productcode,@productname,@productcatagory,@quantity,@spldiscoun ,@units"),cnn1);
//cnn1.Open();
cmd1.Parameters.AddWithValue("@productcode",textBox26.Text);
cmd1.Parameters.AddWithValue("@productname", label12.Text);
cmd1.Parameters.AddWithValue("@productcatagory", label23.Text");
cmd1.Parameters.AddWithValue("@quantity",textBox3.Text);
cmd1.Parameters.AddWithValue("@spldiscoun", textBox4.Text);
cmd1.Parameters.AddWithValue("@units", label17.Text);
cnn1.Open();
MessageBox.Show ("You Successfully Submited");
cmd1.ExecuteNonQuery();
cnn1.Close();