过程或函数""预计参数"但未提供&QUOT ;, [英] Procedure or function "" expects parameter "", which was not supplied
本文介绍了过程或函数""预计参数"但未提供&QUOT ;,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是在asp.net新的跟在后面。
i am new on asp.net with vb.code behind
我试图获取值
我的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
i already try execute store prosedure
declare @p int
exec [cekdatauploads] @p output
print @p
和返回0,不为空值。
在此先感谢!
推荐答案
通过交换两行试试。
esql.CommandText = "cekdatauploads"
esql.Parameters.Add("@value", SqlDbType.Int, 2)
esql.Parameters("@value").Direction = ParameterDirection.Output
esql.ExecuteNonQuery()
如果一件事, cekdatauploads
是一个strored过程中,您应在的CommandType
one more thing if, cekdatauploads
is a strored procedure, you should declare it in the CommandType
esql.CommandType = CommandType.StoredProcedure
esql.CommandText = "cekdatauploads"
esql.Parameters.Add("@value", SqlDbType.Int, 2)
esql.Parameters("@value").Direction = ParameterDirection.Output
esql.ExecuteNonQuery()
这篇关于过程或函数""预计参数"但未提供&QUOT ;,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文