Solved

Is there a DBFactory for DataAdapters in ASP.NET 2.0 / C#?

Posted on 2007-11-21
1
723 Views
Last Modified: 2013-11-07
I have a webpage that creates and fills DataSets using:

    string connString = "Dsn=TEST";
    string sqlSelect = "SELECT * FROM orders";
    OdbcConnection conn = new OdbcConnection(connString);
    DataSet dsOrders = new DataSet();
    OdbcDataAdapter ad = new OdbcDataAdapter(sqlSelect, conn);
    ad.Fill(dsOrders, "Orders");

I want to generalize it by being able to pass the ProviderType during runtime so I dont have to change the code to SqlDataAdapter for when I move this to a SQl Server instead of ODBC. Is there a way to do this?
0
Comment
Question by:bemara57
1 Comment
 
LVL 16

Accepted Solution

by:
SQL_SERVER_DBA earned 500 total points
ID: 20329683
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
cs.Designer Issue 2 20
what technologies offer Authentication over Web Services? 4 73
Jquery autocomplete 10 31
XML & .net 5 21
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now