如何与远程SQL Server 2008连接 [英] How to Connect with Remote SQL Server 2008

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

问题描述

I want to connect with MS-SQL SERVER 2008's Database from a different domain.

The ip of MS-SQL Server 2008 is: 192.168.55.33
Server Name: BDC\SQLEXPRESS
DataBase Name: DMNG
Login: sa
Password: samsung001







My App.config is:
 Collapse | Copy Code
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <!--   User application and configured property settings go here.-->
    <!--   Example: <add key="settingName" value="settingValue"/> -->
    <add key="SqlConnectionString" value="Data Source=192.168.55.33\BDC\SQLEXPRESS;Initial Catalog=DMNG;UID=sa;Password=Support2010; Integrated Security=True;"/>

  </appSettings>
</configuration>







Now I am getting Exception for System.Data.SqlClient.SqlError: "A Network Related Problem" when I am trying to connect with my database.





请帮助我。



Please help me.

推荐答案

试试这个,如果它不起作用,请告诉我。

Try this, and if it is not working, let me know.
<configuration>
  <appSettings>
    <!--   User application and configured property settings go here.-->
    <!--   Example: <add key="settingName" value="settingValue"/> -->
    <add key="SqlConnectionString" value="Data Source=192.168.55.33\SQLEXPRESS;Initial Catalog=DMNG;UID=sa;Password=Support2010; Integrated Security=True;"/>

  </appSettings>
</configuration>





-KR



-KR


在你的cstring:
In your cstring :
<add key="SqlConnectionString" value="Data Source=192.168.55.33\BDC\SQLEXPRESS;Initial Catalog=DMNG;UID=sa;Password=Support2010; Integrated Security=True;"/>





替换:数据源= 192.168.55.33 \SQLEXPRESS或来源= BDC\SQLEXPRESS



试试这个....



或检查Windows身份验证/ Sql Server身份验证如果是Windows身份验证,则来自Cstring的用户名和密码



Replace : Data Source=192.168.55.33\SQLEXPRESS Or Source=BDC\SQLEXPRESS

try this....

Or Check Windows Auth /Sql Server Authentication If Windows Authentication then Username and Password from Cstring


使用此n检查:

Use this n check:
Data Source=192.168.55.33\BDC\SQLEXPRESS,1433


这篇关于如何与远程SQL Server 2008连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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