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 98629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:13:57+00:00 2026-05-11T00:13:57+00:00

When I write an app, I use the System.Data interfaces (IDbConnection, IDbCommand, IDataReader, IDbDataParameter,

  • 0

When I write an app, I use the System.Data interfaces (IDbConnection, IDbCommand, IDataReader, IDbDataParameter, etc…). I do this to reduce vendor dependencies. Unless, I’m doing a simple test app, it just seems like the ethical thing to do when consulting.

However, it seems like all the code I see uses the System.Data.SqlClient namespace classes or other vendor specific classes. In magazines and books it’s easy to chalk this up to Microsoft influence and their marketing spin to program only against SQLServer. But it seams like almost all the .NET code I see uses the SQLServer specific classes.

I realize the vendor specific classes have more functionality, for example adding a parameter to a SqlCommand object is one method, where as adding it to an IDbCommand is an irritating 4+ lines of code. But then again; writing a little helper class for these limitations is pretty simple.

I’ve also wondered if programming against the interfaces when SQLServer is the current target client is over-engineering since it is not required immediately. But I don’t think it is since the cost of programming against the interfaces is so low, where as reducing vendor dependency provides such a huge benefit.

Do you use vendor specific data classes or the interfaces?

EDIT: To summarize some of the answers below, and throw in some thought’s I had while reading them.

Possible pitfalls to using interfaces for vendor neutrality:

  • Vendor specific keywords embedded in your SELECT statements (all my ins, upd, & del’s are in procs, so that’s not a problem)
  • Binding directly the database would probably cause issues.
  • Unless your connection instantiation is centralized, the vendor specific class will need to be called anyway.

Positive reasons to use interfaces :

  • In my experience the ability (even if not exercised) to move to a different vendor has always been appreciated by the customer.
  • Use interfaces in reusable code libraries
  • 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-11T00:13:58+00:00Added an answer on May 11, 2026 at 12:13 am

    There are differences to the SQL you’re going to have to give the classes, depending on the type of database engine you’re talking to, so even if you manage to write all your code to use the interfaces, you still need to write multiple sets of SQL.

    Or, you can do what we have done, write our own layer that takes care of all the syntax we use, which isn’t all the syntax provided by the different engines, but enough to manage to write one SQL that gets properly rewritten before execution.

    Basically we’ve created a function syntax where we prefix the names of the functions with SQL::, which lets our code identify the special functions that needs to be rewritten. These are then parsed out, and rewritten properly, even so far as to swap around argument order if necessary.

    Small things like the name of the function that returns the current server date and time can be done, but also bigger things, like how to select the first N rows of a query.

    Additionally, parameters for SQL Server is written as @name, where OleDb uses positional (just add a ? where you want the parameter), and our code handles those differences as well.

    It pays off in the sense that we don’t worry much about the SQL that needs to be written.

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

Sidebar

Ask A Question

Stats

  • Questions 80k
  • Answers 80k
  • 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 This question has popped up in different, but related, forms.… May 11, 2026 at 4:21 pm
  • Editorial Team
    Editorial Team added an answer How will the class that calls the functor know what… May 11, 2026 at 4:21 pm
  • Editorial Team
    Editorial Team added an answer The problem you're hitting is that ForTypesThatDeriveFrom<T> is a bit… May 11, 2026 at 4:21 pm

Related Questions

In our app, we currently live with the legacy of a decision to store
We have an MSI installer for a .Net WinForms app for Windows XP that
What I need to do is have a C# 2005 GUI app call a
I am using C to write a DLL that provides basic database connection functionality

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.