|
In one of the ExecuteReader Methods, I'm pretty sure there is a bug.
Public Overloads Shared Function ExecuteReader(ByVal connection As SqlConnection, _ ByVal spName As String, _ ByVal ParamArray parameterValues() As Object) As SqlDataReader 'pass through the call using a null transaction value 'Return ExecuteReader(connection, CType(Nothing, SqlTransaction), spName, parameterValues)
Dim commandParameters As SqlParameter()
'if we receive parameter values, we need to figure out where they go If Not (parameterValues Is Nothing) And parameterValues.Length > 0 Then commandParameters = SqlHelperParameterCache.GetSpParameterSet(connection.ConnectionString, spName)
AssignParameterValues(commandParameters, parameterValues)
Return ExecuteReader(CommandType.StoredProcedure, spName, commandParameters) 'otherwise we can just call the SP without params Else Return ExecuteReader(connection, CommandType.StoredProcedure, spName) End If
End Function 'ExecuteReader
that's the original code and here is the new code with the change needed to fix it in bold.
Public Overloads Shared Function ExecuteReader(ByVal connection As SqlConnection, _ ByVal spName As String, _ ByVal ParamArray parameterValues() As Object) As SqlDataReader 'pass through the call using a null transaction value 'Return ExecuteReader(connection, CType(Nothing, SqlTransaction), spName, parameterValues)
Dim commandParameters As SqlParameter()
'if we receive parameter values, we need to figure out where they go If Not (parameterValues Is Nothing) And parameterValues.Length > 0 Then commandParameters = SqlHelperParameterCache.GetSpParameterSet(connection.ConnectionString, spName)
AssignParameterValues(commandParameters, parameterValues)
Return ExecuteReader(<b>connection,</b> CommandType.StoredProcedure, spName, commandParameters) 'otherwise we can just call the SP without params Else Return ExecuteReader(connection, CommandType.StoredProcedure, spName) End If
End Function 'ExecuteReader
If this is not a bug, please accept my apologies, but basically, I believe whoever created it forgot to pass in a parameter! ;) |