Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > BUG: Microsoft.ApplicationBlocks.Data
 

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!  ;) 
MigrationUser 1  Saturday, March 29, 2003 12:14 AM
Looks like you're right. The C# version has that 'connection' arg in there (actually called 'connectionstring' in the C# version.
MigrationUser 1  Sunday, March 30, 2003 5:01 AM
where is the c# version?
MigrationUser 1  Tuesday, April 01, 2003 6:36 AM
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>
MigrationUser 1  Tuesday, April 01, 2003 10:53 AM
dam i thougt it was the c#version of taskvision
MigrationUser 1  Friday, April 04, 2003 7:15 AM

You can use google to search for other answers

Custom Search

More Threads

• Terrarium Server not responding
• Movie Collection Kit - Need Help
• . NET Terrarium 1.2.msi (where is it?)
• TaskVision WebService Source
• reg windows appliation deployment..
• "Terrarium Server Is Experiencing Difficulties" error...
• windows based application Vs winforms application
• .NET Updater Component
• IssueVision for VS2005.
• Canadian Terrarium Contest