c# - Connecting to a database on a LAN network location -
I have an application that I want to access a file on a network. I am currently using this connection string
string myconnectionstring = "provider = Microsoft.Jet.OLEDB.4.0; data source = \\". + PCName + "\\ datafolder \\ data.mdb";
The PC name is the name of the computer well, as I see on the network I use:
Dll Netapi32 However, unless I Let's get the path correctly. My code should say, "C:" instead of path to "\ PCNAME \ datafolder \ data.mdb" I read a lot on this and because my code looks really As far as it should be, I understand no more than it's complexity.
Your code line is looking great enough to add @ before the string or try to add it back \\\\ "+ PCName
string myconnectionstring =" provider = slash like Microsoft.Jet.OLEDB.4.0; Data Source = \\\\ "+ PCName +" \\ datafolder \\ data.mdb ";
If this still causes this problem, then that database is shared as a shared folder Map Drive and some such example is located at a distance of example map Z: (\\ PCName \ ApplicationFolder)
String myconnectionstring = @ "provider = microsoft.jet.OLEDB.4.0; Data source = Z: \ datafolder \ data.mdb ";
This solution is also not working, then the problem may be in the network PC permissions.
Comments
Post a Comment