-2
請幫助!我在瀏覽器中查看了一次該錯誤! :C#沒有從對象類型System.Web.UI.WebControls.TextBox到已知託管提供程序本機類型的映射
不存在從對象類型System.Web.UI.WebControls.TextBox到已知託管提供程序本機類型的映射。
---不能執行 -
================================= ========
SqlConnection conn = new SqlConnection();
SqlCommand cmd = new SqlCommand();
conn.ConnectionString = ConfigurationManager.ConnectionStrings[1].ToString();
cmd.Connection = conn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "ManageMember";
cmd.Parameters.AddWithValue("@check", "a");
cmd.Parameters.AddWithValue("@username", UserNameTxt.Text);
cmd.Parameters.AddWithValue("@password", PasswordTxt.Text);
cmd.Parameters.AddWithValue("@name", FullNameTxt.Text);
cmd.Parameters.AddWithValue("@email", EmailTxt.Text);
cmd.Parameters.AddWithValue("@phone", PhoneTxt.Text);
cmd.Parameters.AddWithValue("@company", CompanyTxt);
cmd.Parameters.AddWithValue("@gender", RdList.SelectedValue);
cmd.Parameters.AddWithValue("@BirthDate", BirthdateTxt.Text);
cmd.Parameters.AddWithValue("@question", Quastxt.Text);
cmd.Parameters.AddWithValue("@answer", AnswTxt.Text);
conn.Open();
cmd.ExecuteNonQuery();
lblMsg.Text = "User Added Successfully";
conn.Close();
將來,總是發佈異常堆棧跟蹤或至少指出哪一行代碼正在拋出異常。 –