SQL连接字符串问题 [英] SQL connection string problem

查看:61
本文介绍了SQL连接字符串问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在访问远程服务器数据库时遇到问题,请提供任何帮助..

我的App.config文件包含



Hello all,
I have a problem accessing my remote server datatbase,any help please..
My App.config file contains

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <appSettings>
          <add key="ConnectionString" value="Data Source=192.168.50.51\ACCTSERVER;Initial catalog=BOM;Integrated security=True;Uid=UserName;Pwd=Password;" />
  </appSettings>
</configuration>

推荐答案

你得到哪个错误.. ??



据我所知&我做了,对于局域网中的远程服务器,首先你必须将sqlserver设置为远程acesseable,并在防火墙中添加访问权限



还有一件事我想在这里添加你使用Data Source = 192.168.50.51\ACCTSERVER

但这里只需要IP地址。
which error you get..??

As I knew & I did, For remote server in a LAN first you have to setup sqlserver to remote acesseable , and also add access permision in firewall.

One more thing I want to add here you use "Data Source=192.168.50.51\ACCTSERVER"
But here only IP address is required.


一旦尝试通过用服务器名称替换IP。



如果仍然存在问题,

然后确保启用TCP / IP并允许允许远程连接。



要启用TCP / IP,请执行以下步骤:

1.打开Sql Server配置管理器

2.在左侧面板中单击SQL Sever网络配置

3.然后进一步单击MSSQLSERVER节点的协议。

4.在右侧面板上你会找到TCP / IP,右键单击它,然后启用。



要在SQL SERVER上允许远程连接,请执行以下步骤:

1.打开MS SQL SERVER与Window连接s或SQL身份验证。

2.右键单击Server并转到属性。

3.在左窗格中单击连接节点。

4.在右窗格中,您会发现CheckBox说允许远程连接到此服务器,选中此框和&单击确定。

5.再次右键单击Server并重新启动SQL Server。
Once try by replacing IP with Server Name.

If still problem exist,
then make sure TCP/IP is enabled and Allow Remote Connection are allowed.

To Enable TCP/IP go trough following steps:
1. Open Sql Server Configuration Manager
2. In left panel click SQL Sever Network Configuration
3. Then further Click on Protocols for MSSQLSERVER Node.
4. On the right panel you will find TCP/IP, Right Click it and just Enable.

To Allow Remote Connection on SQL SERVER go trough following steps:
1. Open MS SQL SERVER connect with Windows or SQL Authentication.
2. Right click on Server and go to properties.
3. In Left Pane click on Connection Node.
4. On Right Pane, you will find CheckBox saying Allow Remote Connection to this Server, Check this box & Click Ok.
5. Again right click on Server and Restart SQL Server.


这篇关于SQL连接字符串问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆