Sql Server 2008缺少参数错误c#代码隐藏
Sql Server 2008表示缺少Sql Server 2008缺少参数错误c#代码隐藏,c#,sql-server,sql-server-2008,C#,Sql Server,Sql Server 2008,Sql Server 2008表示缺少@event\u id参数,但我已确认它有一个值 我已经用相同的事件id测试了usp\u get\u it\u alert\u成员的存储过程,它返回了正确的值 有人能推荐一些额外的故障排除步骤吗 try { Int32 event_id = Convert.ToInt32(Session["event_id"].ToString()); using (SqlConnection cnn = new SqlConnection(GetConnec
@event\u id
参数,但我已确认它有一个值
我已经用相同的事件id
测试了usp\u get\u it\u alert\u成员的存储过程,它返回了正确的值
有人能推荐一些额外的故障排除步骤吗
try
{
Int32 event_id = Convert.ToInt32(Session["event_id"].ToString());
using (SqlConnection cnn = new SqlConnection(GetConnectionString())){
cnn.Open();
using (SqlCommand cmd = new SqlCommand("usp_get_it_alert_members", cnn)){
cmd.Parameters.AddWithValue("@event_id", event_id);
using (SqlDataReader rdr = cmd.ExecuteReader()){
while (rdr.Read()){
...
}
您尚未指定存储过程
cmd.CommandType = CommandType.StoredProcedure;
您尚未指定存储过程
cmd.CommandType = CommandType.StoredProcedure;
谢谢,我以为我疯了。谢谢,我以为我疯了。