Wrox Programmer Forums
|
BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5
This is the forum to discuss the Wrox book Beginning Visual Basic 2005 Databases by Thearon Willis; ISBN: 9780764588945
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 16th, 2006, 11:59 PM
Registered User
 
Join Date: May 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Appendix B - WDABase class

On page 645, when I add the line:

     Implements IDisposable

my code that is automatically populated does not match what is listed (not highlighted) in number 7. Rather than:

     Private Overloads Sub Dispose(ByVal disposing As Boolean)
         If Not Me.disposed Then
             If disposing Then
                 'TODO: put code to disposed managed resources

I get:

#Region " IDisposable Support "
    ' This code added by Visual Basic to correctly implement the disposable pattern.
    Public Sub Dispose() Implements IDisposable.Dispose
        ' Do not change this code. Put cleanup code in Dispose(ByVal disposing _
        ' As Boolean) above.
        Dispose(True)
        GC.SuppressFinalize(Me)
    End Sub
#End Region

which seems to refer above to this:

    Private disposedValue As Boolean = False ' To detect redundant calls

    ' IDisposable
    Protected Overridable Sub Dispose(ByVal disposing As Boolean)
        If Not Me.disposedValue Then
            If disposing Then
                ' TODO: free unmanaged resources when explicitly called
            End If

            ' TODO: free shared unmanaged resources
        End If
        Me.disposedValue = True
    End Sub

I think this is where I am supposed to enter the code in number 7, but it seems to me (though I will admit I am a wet-behind-the-ears newbie) that a "Protected Overridable Sub" is not the same thing as a "Private Overloads Sub".

Anybody know what is going on? Where is my error?

 
Old May 17th, 2006, 05:22 PM
Authorized User
 
Join Date: Dec 2003
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to luishrd
Default

I would insert the code here until we know better LOL...

Protected Overridable Sub Dispose(ByVal disposing As Boolean)
        If Not Me.disposedValue Then
            If disposing Then
                ' TODO: free unmanaged resources when explicitly called
 *************** put the code here ***********
             End If

            ' TODO: free shared unmanaged resources
        End If
        Me.disposedValue = True
    End Sub


__________________________
I'm just a noob
 
Old May 20th, 2006, 05:45 AM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Above the #Region " IDisposable Support " region you should have the Protected Overridable Sub Dispose procedure with the TODO comment. This is where you should enter your code.

Thearon





Similar Threads
Thread Thread Starter Forum Replies Last Post
Appendix Example SQLScott BOOK: Professional WCF Programming: .NET Dev with Windows Communication Found ISBN: 9780470089842 11 January 30th, 2010 06:39 PM
Appendix A john_tempest BOOK: Professional C# 2005 with .NET 3.0 ISBN: 978-0-470-12472-7 1 August 27th, 2007 06:43 AM
wdabase class cf2006 BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 7 July 15th, 2006 05:19 AM
Chapter 6 / Appendix B - Admin / WDABase Classes scgtman BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 3 May 20th, 2006 05:54 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.