質問

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

役に立ちましたか?

解決 2

I have it working with this code

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

他のヒント

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top