我是asp.net的新手,后面是vb.code
我的代码
Dim apps As New MyApps apps.OpenConnection() Dim esql As New sqlCommand esql.Connection = apps.oConn esql.CommandText = "cekdatauploads" esql.Parameters.Add("@value",sqlDbType.Int,2) esql.ExecuteNonQuery() esql.Parameters("@value").Direction = ParameterDirection.Output Dim nilai As Integer = esql.Parameters("@value").Value apps.CloseConnection()
错误是
The parameterized query '(@value int)cekdatauploads' expects the parameter '@value',which was not supplied.
我已经尝试执行商店prosedure了
declare @p int exec [cekdatauploads] @p output print @p
并返回0而不是空值.
提前致谢!
解决方法
尝试通过互换两条线.
esql.CommandText = "cekdatauploads" esql.Parameters.Add("@value",2) esql.Parameters("@value").Direction = ParameterDirection.Output esql.ExecuteNonQuery()
还有一件事,如果cekdatauploads是一个标记过程,你应该在CommandType中声明它
esql.CommandType = CommandType.StoredProcedure esql.CommandText = "cekdatauploads" esql.Parameters.Add("@value",2) esql.Parameters("@value").Direction = ParameterDirection.Output esql.ExecuteNonQuery()
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。