我试图访问存储过程,我收到一个错误,说: Procedure or function ‘getbug’ expects parameter ‘@bugID’, which was not supplied. 这是我调用该过程的代码. SqlCommand cmd = new SqlCommand("getbug", cn);cmd.Paramet
Procedure or function ‘getbug’ expects parameter ‘@bugID’, which was not supplied.
这是我调用该过程的代码.
SqlCommand cmd = new SqlCommand("getbug", cn); cmd.Parameters.Add(new SqlParameter("bugID", bugID));
bugID设置为1089(并且类型为int)
我无法弄清楚为什么这不起作用.
试试这个SqlCommand cmd = new SqlCommand("getbug", cn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@bugID", bugID));