• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 476
  • Last Modified:

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
0
AlStoughton
Asked:
AlStoughton
  • 2
  • 2
1 Solution
 
käµfm³d 👽Commented:
Is your partial class in the same namespace as the original class?
0
 
AlStoughtonAuthor Commented:
I assume so; it's in the same Visual Studio project.
0
 
AlStoughtonAuthor Commented:
I double checked this morning.  Good call on your part!!  Silly oversight on mine.
Thanks for your input!
0
 
käµfm³d 👽Commented:
NP. Glad to help  :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now