Link to home
Start Free TrialLog in
Avatar of AlStoughton
AlStoughtonFlag for United States of America

asked on

How to expose a .net Table Adapter's Data Adapter

I have a AVB.NET project working with SQL  Server 2005 that includes a DataSet with Table Adapters and Binding Sources for several tables.  I'd like to expose the Table Adapter's underlying DataAdapter so that I can monitor the progress of table fill operations using a Progress bar.  A portion of the auto-generated code shows:
Partial Public Class vw_MI_RequisitionTableAdapter
        Inherits Global.System.ComponentModel.Component
       
        Private WithEvents _adapter As Global.System.Data.SqlClient.SqlDataAdapter
       
        Private _connection As Global.System.Data.SqlClient.SqlConnection
       
        Private _commandCollection() As Global.System.Data.SqlClient.SqlCommand
       
        Private _clearBeforeFill As Boolean

and I have tried to add a Partial Class as follows:
Public ReadOnly Property DataAdapter() As System.Data.SqlClient.SqlDataAdapter
            Get
                'Here we return the private member of the tableadapter
                Return _adapter
            End Get
        End Property
    End Class
But the reference to _adapter is marked with the dreaded squiggly underline saying that it isn't declared.

What am I missing here.  And from a broader viewpoint, is there a better eay to tie a Progress Bar to a data table Fill?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AlStoughton

ASKER

I assume so; it's in the same Visual Studio project.
I double checked this morning.  Good call on your part!!  Silly oversight on mine.
Thanks for your input!
NP. Glad to help  :)