hi ,
I'm Trying to Call the Stored Procedure which has one input Parameter and one output parameter . VB.net code is below
I got result 0 instead of 7.
Thanx in Adv
Ganesh
I'm Trying to Call the Stored Procedure which has one input Parameter and one output parameter . VB.net code is below
Code:
dim C as int16 , A as int16
A = 5
cmd = New SqlCommand("[Addition]", cn)
cmd.CommandType = CommandType.StoredProcedure
With sqlparam1
.ParameterName = "@A"
.SqlDbType = Int
.Value = A
End With
With sqlparam2
.ParameterName = "@B"
.SqlDbType = Int
.Direction = ParameterDirection.Output
End With
With cmd
.Parameters.Add(sqlparam1)
.Parameters.Add(sqlparam2)
.CommandType = CommandType.StoredProcedure
C = CType(cmd.Parameters("@B").Value, Int16)
Thanx in Adv
Ganesh
Comment