Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3345190
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:09:25+00:00 2026-05-18T01:09:25+00:00

This is my first post on Stack Overflow so please exuse (and feel free

  • 0

This is my first post on Stack Overflow so please exuse (and feel free to point out) any n00b mistakes.

I am trying to implement transactions across multiple TableAdapters in VB.NET (using Visual Studio 2010) by extending the partial class as described in the following examples:

http://blah.winsmarts.com/2006/06/18/the-definitive-tableadapters–transactions-blog-post.aspx

madprops.org/blog/typed-datasets-and-sqltransaction/

stackoverflow.com/questions/2342289/net-tableadapter-to-dataadapter

However, when I attempt to expose any of the private fields created by the designer they are underlined in the editor with the following error:

‘_adapter’ is not declared. It may be inaccessible due to its protection
level.

Searching this site as well as google has not revealed anything useful, but perhpas I’m searching the wrong keywords.

Here is the code in MyDataset.vb

Partial Public Class MyTableAdapter
    Public Property MyTransaction() As SqlTransaction
        Get
            Return _adapter.SelectCommand.Transaction
        End Get
        Set(ByVal value As SqlTransaction)
            If _adapter Is Nothing Then
                InitAdapter()
            End If
            Connection = value.Connection
            _adapter.InsertCommand.Transaction = value
            _adapter.UpdateCommand.Transaction = value
            _adapter.DeleteCommand.Transaction = value
        End Set
    End Property

End Class

and here is the designer code:

Partial Public Class MyTableAdapter
    Inherits Global.System.ComponentModel.Component

    Private WithEvents _adapter As Global.System.Data.SqlClient.SqlDataAdapter
    Private _connection As Global.System.Data.SqlClient.SqlConnection
    Private _transaction As Global.System.Data.SqlClient.SqlTransaction
    Private _commandCollection() As Global.System.Data.SqlClient.SqlCommand

Am I missing something, or is this not possible in VB (all of the examples I’ve seen are in C#)?

TIA for any help!

JE

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T01:09:26+00:00Added an answer on May 18, 2026 at 1:09 am

    Can you access any Public properties/methods from the Adapter class?

    I think you may have created your partial class in the wrong namespace. It has to be in Namespace MyDataSetTableAdapters

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Woot, first Stack Overflow post! I've been asked to work on a desktop application
Hey, this is my first post on stackoverflow. I'm trying to replace é with
For Starters, i would like to note, that this is my first post on
This is my fist stackoverflow post so please be gentle with me! I'm sure
I have been going through this page to install zend framework on my machine
UPDATE : Once I looked at the problem in Firebug, I found my mistake
I am developing a MVC application with PHP that uses XML and XSLT to
EDIT: It seems that the formatting of the json string is not the problem.
I have to make a web service client from an wsdl file. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.