代碼顯示如下:錯誤插入值到數據庫中asp.net,登記表的C#
nection cnn = new SqlConnection("Data Source=USER-PC\\KHEMCHAND;Integrated Security=True");
protected void Page_Load(object sender, EventArgs e)
{
cnn.Open();
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlCommand cmd = new SqlCommand("insert into tbl_ragistration values(@f_name,@l_name,@email_id,@pass_word,@[date of brth],@add_ress,@gender)", cnn);
cmd.Parameters.AddWithValue("@f_name", Texfname.Text);
cmd.Parameters.AddWithValue("@l_name", Texlname.Text);
cmd.Parameters.AddWithValue("@email_id", Texemail.Text);
cmd.Parameters.AddWithValue("@pass_word", Texpwd.Text);
cmd.Parameters.AddWithValue("@[date o birth]", Texdbt.Text);
cmd.Parameters.AddWithValue("@add_ress", Texadd.Text);
cmd.Parameters.AddWithValue("@gender", DropDownList1.Text);
cmd.ExecuteNonQuery();
cnn.Close();
}
** ** WHAT是誤差Δθ請發佈完整且準確的錯誤消息.... – 2012-03-08 05:58:53