简体   繁体   中英

Accessing a database on a mapped drive in c#

I have built a SQL database program that holds part numbers and details about them. Right now the program works locally on my machine. However, what I need to do is have the program access the database on a network drive (eg. the L:\\ drive). This way, a user can have their own copy of the program, but all the data that is sent and received is done to that common networked database. I have been playing around and also searching online, but cannot seem to find anything, and I am a database beginner. Any help would be much appreciated. Thanks.

What you want to do is install a sql server instance somewhere on your network . Then use a connection string rather than a drive location to access the data.

This is the standard way to share data across applications.

THe problem with this approach is locking and multiuser support to put it simply. You will run into users contending for access to the file . You need a DB server ( SQL Server , Sql Server Express, MySQL , etc etc) to handle this problem for you . The DB server can running on that network server .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM