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

  • Home
  • SEARCH
  • 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 117129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:17:14+00:00 2026-05-11T03:17:14+00:00

I want a strongly-typed DataSet along with designer TableAdapters, but Visual Studio’s DataSet designer

  • 0

I want a strongly-typed DataSet along with designer TableAdapters, but Visual Studio’s DataSet designer generates provider-specific (e.g. SQL Server vs. MySql) code and I don’t want to commit to just one provider. An ORM would help, but:

  • Entity Framework is 3.5 only and doesn’t play nice with DataSets, and
  • NHibernate doesn’t support SQLite.

Here’s what I’ve come up with:

‘DataSets.Masters’ contains a completely designed DataSet bound to some particular provider (e.g. SqlClient), including:

  • a CustomTableAdapter component, subclassed by each designer TableAdapter,
  • an ITableAdapterManager interface, implemented by designer’s TableAdapterManager for hierarchical updates.

Everything except the DataSets.MyDataSetTableAdapters namespace is copied into the ‘DataSets’ project, where all the TableAdapter code (along with xs:annotation) is removed.

The DataSets.MyDataSetTableAdapters namespace, along with MyDataSet.xsd etc., is copied and customized into each of ‘DataSets.SqlClient’, ‘DataSets.SQLite’, etc. each of which references the ‘DataSets’ assembly.

Now I just have to choose the right assembly to load my ITableAdapterManager implementation from, based on any given connection string. When the table schema changes, I modify the Masters assembly, copy code to the production assemblies, and run a few tests.

So my question: am I making this too difficult? DataSets are so standard, and the need to support multiple database engines via the data access layer is so common, is there a method that doesn’t involve copy, paste, and search & replace? What do you do?

  • 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. 2026-05-11T03:17:15+00:00Added an answer on May 11, 2026 at 3:17 am

    It might be easier to simply ignore the autogenerated TableAdapter commands and use the ADO.Net data access factory objects when it’s time for your CRUD operations. That way you can use DbProviderFactory.CreateCommandBuilder to correctly format the parameters in the CRUD operations. Note that this assumes that you aren’t doing any tricky property mapping and your schema will remain consistent across data providers.

    An aditional option if you use this technique is to create a class that you can enter as the BaseClass property on your TableAdapters. Add an ‘init’-type method that overrides the connection and the insert, delete, select, and update commands with ones from the factory (based on the auto-generated select command—which should be compatible across most providers).

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

Sidebar

Ask A Question

Stats

  • Questions 85k
  • Answers 85k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer WHERE SUBCAT = 'fake' and USERNAME = 'testuser' Should be:… May 11, 2026 at 5:08 pm
  • Editorial Team
    Editorial Team added an answer Here's a nice one-pass algorithm that I just came up… May 11, 2026 at 5:08 pm
  • Editorial Team
    Editorial Team added an answer Guys after googling lot i have collected few useful links… May 11, 2026 at 5:08 pm

Related Questions

I want a strongly-typed DataSet along with designer TableAdapters, but Visual Studio's DataSet designer
Is there a relatively easy way to extract a relationship-consistent subset of a DataSet
Please keep in mind that I'm new to C# and OOP so I apologize
This is my first question on StackOverflow.com and I'm not sure if this is
I am writing a site that uses strongly typed datasets. The DBA who created

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.