如何连接到网络SQL Server数据库 [英] how to connect to network SQL server database

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

问题描述

大家好,



我创建了一个带有sql server作为数据库的Windows应用程序。该应用程序在localhost上工作正常,但没有链接到服务器数据库。它在sql连接中显示Issue的消息。





以下是我在模块中使用的连接字符串,我在服务器上的sql配置管理器中启用了TCP / IP并禁用了防火墙。

请建议..



公共连接为新SqlConnection(数据源= \\WIPRO-PC\SQL2012 ;初始目录=数据库;用户ID = sa;密码= 1233456)



这里WIPRO-PC是我能够通过运行打开的hte服务器的名称和SQL2012是实例的名称

解决方案

还将服务器配置为接受来自不同计算机的连接 - 它可以配置为仅接受来自localhost的连接。

Hi All,

I have created a windows app with sql server as database. The app is working fine on localhost but not getting linked to server database. it shows message of Issue in sql connection.


Following is the connection string I am using in module and I have enabled TCP/IP in sql configuration manager on Server and disabled the firewall.
Pls suggest..

Public connection As New SqlConnection("Data Source=\\WIPRO-PC\SQL2012;Initial Catalog=database;User ID=sa;Password=1233456")

Here WIPRO-PC is the name of hte server which I am able to open through run and SQL2012 is the name of the instance

解决方案

Also configure the server to accept connections from different computers - it may be configured to accept connections from localhost only.


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

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