谁帮我看看ASP.net中执行一条带参数存储过程代码错在哪里?
string nameJs = DropDownList_name.Text.Trim();
string nameFs = Session[ "Name "].ToString().Trim();
string SSH = TextBox_SSH.Text.Trim();
string text1 = TextBox_NeiRong.Text.Trim();
string myConn_str = System.Configuration.ConfigurationManager.ConnectionStrings[ "Mobile2ConnectionString "].ConnectionString;
Response.Write(myConn_str);
SqlConnection myConn = new SqlConnection(myConn_str);
myConn.Open();
SqlCommand cmd_sendM = new SqlCommand( "sp_send_Can4 ", myConn);
cmd_sendM.CommandType = CommandType.StoredProcedure;
cmd_sendM.Parameters.AddWithValue( "@nameJs ", nameJs);
cmd_sendM.Parameters.AddWithValue( "@nameFs ", nameFs);
cmd_sendM.Parameters.AddWithValue( "@SSH ", SSH);
cmd_sendM.Parameters.AddWithValue( "@text1 ", text1);
//cmd_sendM.Parameters.AddWithValue( "@number ", number);
try
{
cmd_sendM.ExecuteNonQuery();
}
catch (SqlException ae)
{
Response.Write(ae.Message.ToString());
}
Response.Write( "发送完成 ");
------解决方案--------------------把报错信息贴上来。
------解决方案--------------------错误信息?
------解决方案--------------------myConn.close();