Hi
I have the code below which i got from:
It only appers to return 1 from the stored procedure, where as the figure
should be 43253
Any help with a solution would be much appreciated,
Thanks
B
'Calling Function
Dim Parameters(0) As SqlParameter
Parameters(0) = New SqlParameter("@iReturn", SqlDbType.Int) :
Parameters(0).Value = 0
intCaseItem_No = SqlDataProvider.ExecuteQuery(strConnectionString,
"sp_GetClientID", CommandType.StoredProcedure, Parameters)
'Function
Public Shared Function ExecuteQuery(ByVal ConnectionString As String, ByVal
CommandText As String, ByVal CommandType As CommandType, _
ByVal CommandParameters() As SqlParameter) As Object
Dim ReturnValue As Object = Nothing
Try
SqlConn = New SqlConnection(ConnectionString)
SqlComm = New SqlCommand(CommandText, SqlConn)
SqlComm.CommandType = CommandType
Dim OutputParameter As String = SqlDataProvider.AddParameters(SqlComm,
CommandParameters)
If Not (SqlConn.State = ConnectionState.Open) Then SqlConn.Open()
ReturnValue = SqlComm.ExecuteNonQuery()
If Not (OutputParameter = String.Empty) Or OutputParameter <> "" Or
CommandType = CommandType.StoredProcedure Then
ReturnValue = SqlComm.Parameters(0).Value.ToString()
End If
Catch ex As Exception
_LastError = ex
Finally
If Not (SqlConn.State = ConnectionState.Closed) Then SqlConn.Close()
End Try
Return ReturnValue
End Function