简体   繁体   中英

Can't access the DataBase (.mdf file) in my WPF application from PC's on network

I created a wpf application which connect to some sql database tables. When i run this application on my pc every thing works fine,but when i try to run it from other pc on the local network i got an error: "The file ("file name") is on a network path that is not supported for database files".

What is the best way to create a WPF application that have to run from some pc's on the local network that share a common DB?

Have you considered a database server, SQL Server, MySQL, or something similar? If you really want to stick to a file based database (something I wouldn't recommend for security reasons) then you can use something like SQLite.

You will only be able to connect to your server (your pc in this case) instance from another pc if you have 'named pipes' enabled. You can also enable TCP\\IP etc. if needs be, but this is probably why you are getting the error.

Named Pipes is not available in the Compact or Free versions of MSSQL.

A database server or pc with a proper version of MSSQL is your best bet.

yepppp solved. Thanks for your answers. I did some things that finally solved my problem: 1. Remove the "uid=Tomer, pwd=, and pooling=False" from the connection string. 2. Enable Port 1433(sql port) in the firewall. 3. Enable the TCP/IP and the 'named pipes' as i mentioned before.

Thanks alot for your help.

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