[英]C# No mapping exists from object type System.Web.UI.WebControls.TextBox to a known managed provider native type
Please Help!I got this err once i viewed in browser !!请帮助!我在浏览器中查看后出现此错误! :
:
No mapping exists from object type System.Web.UI.WebControls.TextBox to a known managed provider native type.不存在从对象类型 System.Web.UI.WebControls.TextBox 到已知托管提供程序本机类型的映射。
--- Not Able to execute -- --- 无法执行-
========================================= ==========================================
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();
Change改变
cmd.Parameters.AddWithValue("@company", CompanyTxt);
To到
cmd.Parameters.AddWithValue("@company", CompanyTxt.Text);
Then smack yourself in the forehead.然后打自己的额头。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.