1

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?

3 Answers3

1

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.

CodingGorilla
  • 19,612
  • 4
  • 45
  • 65
  • I created local database server SQLEXPRESS on my pc as well, my application accessed the DB fine on my pc, but from other pc on the network i got an error again. how do i enable my application access the DB from other pc on that way? – Tomer Fleger Feb 06 '13 at 11:03
  • You would need to enable one of the network protocols in SQLEXPRESS, check this SO answer: http://stackoverflow.com/questions/2486610/how-to-connect-to-sql-server-from-another-computer – CodingGorilla Feb 06 '13 at 11:05
0

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.

Charl
  • 982
  • 6
  • 12
  • First Thanks for your answers. I use Microsoft SQL Server 2008 R2. I enabled both the TCP\IP and the 'named pipes' on the pc's network. Now i get "session timeout" error. Is there any idea? – Tomer Fleger Feb 06 '13 at 13:32
  • The error: "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding". What should i do? – Tomer Fleger Feb 06 '13 at 14:28
0

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.