i need Help

I started a project that is using a Access Database.

Now I loaded the Database in my Database Explorer in Visual Studio. I have already set the connection

with the Asistent. Because i am working at home, the destination of my Project is differen then the destination in my enterprise. But i dont want to have the database in the same location like the executable and the project files.

What i need is to change the connection string of this database at runtime. For example i make a codet that is looking for the database in all locations, when he has found the right location he change the connection string of this database to the new one.

But i am not speaking about DataAdapter, DataSet or DataTable, it is a Databae that i connct already in the Project on the left side in a Database explorer.

can u help me....

thanks you.... excuse me for my english, i am not very fort in english

[985 byte] By [someone_ch] at [2007-12-23]
# 1

This should be very easy.

Change the directory path to a shared drive on the network, then all end users will be able to query it through your application.

Adamus

AdamusTurner at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 2

HI,

I assume that you are using the wizard to access your database. If that's so, then you can see your connection string in the generated xsd file. Try looking for it in your project explorer.

Or you can find your connection object that was generated and manually change the connecitonstring property at runtime...

cheers,

Paul June A. Domag

PaulDomag at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 3

Thanks a lot for you help..

Now i decide to work with normaly Dataset and DataAdapters.

I wont to use my Program localy on the pc, and the Database shoud be on a network disk. So after install the software on a client i can also use a xxxx.udl file for managing the access to the Database. I think this is a old kind of connection but it should be very easy to change if i need it. Now i try to access the Database over this .....udl file. Connection was I.O. But i after i change the Name of my Database or the location of the Database, and i also updated the changes in the ... udl file, my VB.Express can not find the Database. Why VB donf find the Database? In the Settings.settings of my Project i have already updated that this connection for the DataSet is now ovet the ...udl file but after Changing the location or the Name of Database, and after modifing my udl file their is no connection?!

What i have made wrong?

someone_ch at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 4

HI,

Have you tried testing the connection on the udl? I mean by pressing the test connection button of the udl. This is to ensure that this is not a security problem over your netwok. If it succeeded then make sure that your connection string in your settings is the one being used by your dataadapters. And also check if the proper udl file is being referenced by your program...

cheers,

Paul June A. Domag

PaulDomag at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 5

Thanks you a lot fro trying help me.

I have already found some tutorials that should help me.

with best wishes

someone_ch

someone_ch at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...

.NET Development

Site Classified