I am trying to deploy my Visual Studio 2012 express LocalDB project to a remote host (another server in the sandbox) which is runnning SQL SERVER 2012 express. I changed the connection string in the web.config to match the instance name but it still doesnt work. Each time it fires off a dataset it fails with an error stating it cant find the instance.
我正在尝试将我的Visual Studio 2012 express LocalDB项目部署到运行SQL server 2012 express的远程主机(沙箱中的另一个服务器)。我更改了web中的连接字符串。配置以匹配实例名,但它仍然不起作用。每次启动数据集时,它都会失败,并出现一个错误,说明它无法找到实例。
Will I really have to go through the Dataset.Desinger.vb file and change the server\instance name for every project I do using LocalDB?
我真的需要检查数据集。desinger。vb文件,并为我使用LocalDB的每个项目更改服务器\实例名?
How exactly is this suppose to make things easier? :)
这究竟是如何使事情变得更容易的呢?:)
Dataset.Designer.vb autogenerated connection code:
Dataset.Designer。vb代码自动生成连接:
Private Sub InitConnection()
Me._connection = New Global.System.Data.SqlClient.SqlConnection()
Me._connection.ConnectionString = "Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated" & _
" Security=True;User Instance=False"
End Sub
1 个解决方案
#1
0
You should be sure that you make SQL Servers TCP/IP configuration right. I had the same problem before and I solved it by changing SQL Server Protocol UDP to 1434. Open Windows Firewall with advanced security. Find in left side Inbound Rules tab and click. Then find SQL Server and right click. Click properties. In Protocols and Ports tab change protocol type to UDP and as port number give 1434. I hope it helps.
您应该确保正确配置了SQL服务器TCP/IP。我以前遇到过同样的问题,我通过将SQL Server Protocol UDP更改为1434解决了这个问题。使用高级安全性打开Windows防火墙。在左侧入站规则选项卡中找到并单击。然后找到SQL Server并右击。单击“属性”。在协议和端口选项卡中,将协议类型更改为UDP,如端口号为1434。我希望它有帮助。
#1
0
You should be sure that you make SQL Servers TCP/IP configuration right. I had the same problem before and I solved it by changing SQL Server Protocol UDP to 1434. Open Windows Firewall with advanced security. Find in left side Inbound Rules tab and click. Then find SQL Server and right click. Click properties. In Protocols and Ports tab change protocol type to UDP and as port number give 1434. I hope it helps.
您应该确保正确配置了SQL服务器TCP/IP。我以前遇到过同样的问题,我通过将SQL Server Protocol UDP更改为1434解决了这个问题。使用高级安全性打开Windows防火墙。在左侧入站规则选项卡中找到并单击。然后找到SQL Server并右击。单击“属性”。在协议和端口选项卡中,将协议类型更改为UDP,如端口号为1434。我希望它有帮助。