【发布时间】:2010-07-03 08:10:18
【问题描述】:
protected void Button2_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection("Data Source=KING;Initial Catalog=semasinter;Integrated Security=True");
SqlCommand command = new SqlCommand("insert into StudentApplication", conn);
command.CommandType = CommandType.StoredProcedure;
command.CommandText = "spinsertstudentapplication";
command.Parameters.AddWithValue("@Student_id", TextBox1.Text);
//command.Parameters.AddWithValue ("@Select_Course", ddlCourse.SelectedValue);
command.Parameters.AddWithValue("@Select_Country", TextBox4.Text);
command.Parameters.AddWithValue("@Select_State", TextBox2.Text);
command.Parameters.AddWithValue("@Select_Franchise", TextBox3.Text);
command.Parameters.AddWithValue("@Select_Sensei", ddlSensei.SelectedValue);
command.Parameters.AddWithValue("@Group", TextBox6.Text);
command.Parameters.AddWithValue("@Enter_Student_Name", TextBox7.Text);
command.Parameters.AddWithValue("@Enter_Student_Address", TextBox8.Text);
command.Parameters.AddWithValue("@Students_Father_Name", TextBox9.Text);
command.Parameters.AddWithValue("@Student_DOB", TextBox10.Text);
if (RadioButton2.Checked == true)
{
command.Parameters.Add("@Gender", SqlDbType.Bit).Value = true;
}
else
{
command.Parameters.Add("@Gender", SqlDbType.Bit).Value = false;
}
command.Parameters.Add("@Enter_Kyu", SqlDbType.NVarChar).Value = TextBox11.Text;
conn.Open();
int rows = command.ExecuteNonQuery(); //// in these line i got a error message
conn.Close();
}
朋友们可以帮帮我吗
【问题讨论】:
-
帮助?什么?你没有问任何问题。
-
你得到什么错误信息?
-
告诉我们更多关于您要插入的表的信息。它有任何唯一索引吗?你现在有没有例外,如果有,他们怎么说?
-
不同的问题标题,和不同的post中的问题??我回答你的问题取决于标题
-
不要不要一直重复这个问题。如果你想添加细节,编辑这个。
标签: c#