문제

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