VPSで実行されているMSSQLServer2005Expressがあります。Pythonでpymssqlを使用して、次のコードでサーバーに接続しています。
conn = pymssql.connect(host='host:port', user='me', password='pwd', database='db')
そしてそれは完璧に動作します。次のコードを使用してASP.NETC#ページからサーバーに接続しようとすると:
SqlConnection myConnection = new SqlConnection("Data Source=host,port;Network Library=DBMSSOCN; Initial Catalog=db;User ID=me;Password=pwd;");
myConnection.Open();
ASP.NETページを実行すると、myConnection.Open();で次の例外が発生します。
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: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)
SQL Serverを再起動しようとしましたが、うまくいきませんでした。誰かが私がここで欠けているものを指摘できますか?
ありがとう!