VB中 使用 存储过程
ExecSp(ByVal spName As String, ByVal paramArr() As SpParameter, ByRef returnHash As Hashtable) As Integer
这个是执行存储 过程的方法
下面是我调用存储过程的方法, 执行的时候总是不对 ~
请大家指教~~
Public Function updateDemoByProc(ByVal newrow As DataRow) As Integer Dim para() As SpParameter = New SpParameter() {New SpParameter(), New SpParameter(), New SpParameter(), New SpParameter()} para(0).ParamName = "@id" para(0).ParamValue = newrow.Item(Demo.D_id) para(0).ParamType = "input" para(1).ParamType = "input" para(2).ParamType = "input" para(3).ParamType = "input" para(0).ParamSize = 8 para(2).ParamSize = 8 para(1).ParamSize = 50 para(3).ParamSize = 50 para(1).ParamName = "@name" para(1).ParamValue = newrow.Item(Demo.D_name) para(2).ParamName = "@age" para(2).ParamValue = newrow.Item(Demo.D_age) para(3).ParamName = "@address" para(3).ParamValue = newrow.Item(Demo.D_address) Dim hash As Hashtable = New Hashtable Return Me.dba.ExecSp("proc_updateDemo", para, hash) End Function