.Net WPF app connecting to SQL 2008 R2 running on Win Server 2008
This is a recent problem. Probably started in the last day or two. Not sure because I haven't tested on the server since...
I have a WPF app that runs on a Win 8 Tablet. I have the tablet on my desk. I also have a copy on my client's server in Canada.
From my development PC the app CAN connect to SQL on my server. I copy the app to the tablet and run it and it does NOT connect. I get:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) ---> System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
I get the same trying to run it from the client's server. Both the tablet and the copy on the client's server were connecting a few days ago.
The server's IP/Port are hardcoded in (to test), so that hasn't changed.
I checked all the user remote connection settings. Everything looks fine. The part that worries me is the "File not found" part. And why do I NOT get this connecting from my Dev pc??
There are several reasons there and none of which should apply to you because, presumably, nothing changed.
However the nature of those tells you the problem - it could not establish the connection.
Now you might want to at least verify that someone wasn't bouncing the server when you had the problem. You can see that in the event log if SQL Server restarted.
If not then it is likely it is a network problem.
"The server's IP/Port are hardcoded in (to test), so that hasn't changed."
And that's a public IP address somewhere on the web where it can be reached without restrictions? Or is it something like 192.168.0.42?
If you mean the way that takes you the least amount of time then it depends on your experience.
If you mean something where there are large amounts of date, then database import/export tools are often fastest. If small amounts of data then any mechanism will likely take the same time as any other.