-5
if (CheckBox1.Checked == false)
{
Label2.Text = "Enter Value !!";
String strConnString = ConfigurationManager.ConnectionStrings["CallcenterConnectionString"].ConnectionString;
SqlConnection con = new SqlConnection(strConnString);
SqlCommand cmd = new SqlCommand("insert into CallCenter..Loy_DispMstr (CallType, SUBFormat, Disposition, SubDisposition) values (@CallType, @Format, @Disposition, @SubDisposition)", con);
cmd.Parameters.Add("@CallType", ddlCalltype.SelectedItem.Value);
cmd.Parameters.Add("@Format", ddlFormat.SelectedItem.Value);// error on this
cmd.Parameters.Add("@Disposition", ddlDisp.SelectedItem.Value);
cmd.Parameters.Add("@SubDisposition", ddlSubdisp.SelectedItem.Value);
con.Open();
int i = cmd.ExecuteNonQuery();
con.Close();
Label2.Text = " Your data is been saved in the database";
Label2.ForeColor = System.Drawing.Color.ForestGreen;
}
else if (flag == 0 && CheckBox1.Checked == true)
{
String strConnString = ConfigurationManager.ConnectionStrings["CallcenterConnectionString"].ConnectionString;
SqlConnection con = new SqlConnection(strConnString);
SqlCommand cmd = new SqlCommand("insert into CallCenter..Loy_DispMstr (CallType, SUBFormat,Disposition, SubDisposition) values (@CallType, @Format,@Disposition, @SubDisposition)", con);
cmd.Parameters.Add("@CallType", ddlCalltype.Text);
cmd.Parameters.Add("@Format", ddlFormat.Text);
cmd.Parameters.Add("@Disposition", TextBox1.Text);
cmd.Parameters.Add("@SubDisposition", TextBox2.Text);
con.Open();
int i = cmd.ExecuteNonQuery();
con.Close();
Label2.Visible = CheckBox1.Checked;
Label2.Text = " Your data is been saved in the database";
Label2.ForeColor = System.Drawing.Color.ForestGreen;
}
我想你錯過了提問的要點。 – Marco
我的問題是非常直接的 – user31121992
甚至沒有問號:D –