How to change data provider of a dataset?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created some datasets and they are created with oledb data provider.
Now, I want to change them to sqlclient. How can I change it?
 
Peter,

Your datasets themselves don't have really connections to the server. The
strongly typed datasets in version 2005 and later have extras that can set
retrieval functions for that.

However the dataset it self is the same for all providers.

The connection, comands and adapter classes are not the same. You can use
the factory class if you want to use both, if it is about just replacing,
then a find and replace after saving first your project will probably be the
easiest.

http://www.vb-tips.com/DataBaseFactory.aspx

Cor
 
Hi Cor,

I just want to replace them so all connections are using SqlClient. For
VS2005 dataset, what files/properties I need to replace?

These are what I find so far:

- ConnectionString of TableAdapter
- Dataset.Designer.vb


Peter
 
Peter,

You can start with searching your whole project including the generated
classes for "OleDB" all classes which use that Start with that. Replacing
those for "Sql" will probably all you have to do. (However save your project
first)

As I wrote the dataset class itself is not dependend from a provider,
however the generic dataset of 2005 or later can have parts to get the data,
although those classes then start as well with OleDB.

Cor
 
Back
Top