-2

Hey all I am currently trying to connect to a database on a differnt server from where the .ASPX file is being called from.

In VS2013, in debug, It calls the query just fine without problems but once I compile and call that same page from the actual web server it displays this error:

sql query error

The MS SQL server I am calling is a 2008 version.

The connection string I have tried are:

Dim sqlQ As SqlCommand = Nothing
Dim conn As SqlConnection = Nothing
Dim reader As SqlDataReader = Nothing

Dim strConnString As String = "Data Source=zzSQL004;Initial Catalog=C_Data;Trusted_Connection=True;Integrated Security=SSPI;"
Dim strConnString As String = "Server=zzSQL004,2866;Database=C_Data;User Id=C_user;Password=zzzzzzz;"
Dim strConnString As String = "Data Source=zzSQL004;Initial Catalog=C_Data;Persist Security Info=True;User ID=C_user;Password=zzzzzzz"
Dim strConnString As String = "Data Source=zzSQL004,2866;Initial Catalog=C_Data;Trusted_Connection=True;Integrated Security=SSPI;User ID=C_user;Password=zzzzzzz"
Dim strConnString As String = "Data Source=zzSQL004,2866;Initial Catalog=C_Data;Persist Security Info=True;User ID=C_user;Password=zzzzzzz"
Dim strConnString As String = "Data Source=zzSQL004\PNC_user;Initial Catalog=C_Data;Persist Security Info=True;User ID=C_user;Password=zzzzzzz"
Dim strConnString As String = "Provider=SQLOLEDB.1;Password=zzzzzzzz;Persist Security Info=True;User ID=C_user;Initial Catalog=C_Data;Data Source=zzSQL004"

In my Web.config file I have no to the database since I have the code above I am using. I am starting to wondering wither that is causing the issue or not?

I am just wondering what I could be forgetting in order to make this connection work? I spoke to the DBA's and they say everything is working/configured as it should be. Remote connection is enabled and all. It's just odd that in debug inside VS2013 I can get to it (which is on a different PC - not on the DB/web server itself) yet once on the server I can not.

Any help would be great!

4

1 回答 1

0

听起来像一个网络问题,我会做以下事情:

  1. 从 Web 服务器 ping 数据库服务器
  2. 在 Web 服务器上使用 telnet 在特定端口上打开与 SQL 服务器的连接
于 2014-08-11T20:42:58.127 回答