Question

I'm developing an application that needs to access files on computers in an intranet, the files are database files and each computer has its own database, from what i have read i need to use a //server connection string, however I want to code my application in such a way that the user selects the computer they want to retrieve the that from for example they would select "Computer 2" and the application would create the connection string, connect to the database and populate it

Était-ce utile?

La solution 2

I have it working with this code

string myconnectionstring = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\" + PCName + @"\data\data.mdb"

Autres conseils

I would recommend creating a connection string for each machine you are accessing in the web.config file and then using the user's selection to pull the correct connection string from the config file to instantiate the connection.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top