BUG: Microsoft.ApplicationBlocks.Data

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! ;)

[2268 byte] By [codefund.com] at [2008-2-21]
# 1
Looks like you're right. The C# version has that 'connection' arg in there (actually called 'connectionstring' in the C# version.
codefund.com at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Sample Applications...
# 2
where is the c# version?
codefund.com at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Sample Applications...
# 3
Here?

<a href=" http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/daab-rm.asp">Data Access Block for .NET</a>

codefund.com at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Sample Applications...
# 4
dam i thougt it was the c#version of taskvision
codefund.com at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Sample Applications...