Support for multiple database

  • Thread starter Thread starter Mike TI
  • Start date Start date
M

Mike TI

May 2, 2006

Hi All

I have been learning VB.Net 2005 by developing a small project.

I have been using SQL Express till now.

Now I have built a similar to SQL Data Base in MS Access. I tried to use the
MS Access Data Base in my application but am unable to do so.

1. I attached the MS Access Data Base in the "Server Explorer"
2. I changed the connection string in the "APP.CONFIG" file

Please guide me on how to build support for multiple database in an
application.

Thanks
Mike TI
 
Thank you for your reply. I have looked at the example which was very
interesting.

Now, I have built an application and have used SQL Express.

I want to change the application so as to use MS Access. (Not both at the
same time)

What do I have to do in the current application so as to be able to use MS
Access database ?
Mike TI
 
Mike,

In your current app are you using the SQLClient namespace classes, such as
SQLConnection, SQLCommand, SQLDataAdapter, etc?

If so, you will need to change your app to use OleDB namespace classes, such
as OleDBConnection, OleDbCommand, etc.

Kerry Moorman
 
Mike,
Thank you for your reply. I have looked at the example which was very
interesting.

Now, I have built an application and have used SQL Express.

I want to change the application so as to use MS Access. (Not both at the
same time)
That is why this factory is in Net 2.0 build.

Cor
 
Kerry

I tried using your tip and it worked very fine. Thank you.

I kept the "Data Connection Name" same in both cases, hence I had to change
only the "Connection String". Please note I did not change anything in the
app.config, DataSet.xtd files.

Q1. Do I need to change app.config, DataSet.xtd files. If yes, how ?
Q2. Can I store the value of the Connection String in a variable and use
this variable where the string needs to be defined ?
Q3. Where do I define this variable ?

Your help is much appreciated.
Mike TI
 
Back
Top