在网络上连接SQL Server时发生错误 [英] error occured while connecting sql server on the network

查看:70
本文介绍了在网络上连接SQL Server时发生错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我给出以下编码

I give the following coding

Public con As New SqlConnection("Data Source=192.170.1.90,1433;Network Library=dbmssocn;Initial Catalog=phoneix;User Id=sa;Password=welcome;Integrated Security=SSPI")



连接SQL Server时发生此错误



This error occured when I connecting sql server

A network related or instance error will occured
a connection attempt failed because the connected party did not properly respond or establishing hosted is failed 



请帮助我解决此问题.



Please help me solve this problem

推荐答案

这意味着您的vb.net应用程序无法连接到SQL Server.检查连接字符串(IP,用户名等)& SQL服务器配置为接受通过IP进行的远程连接

检查用于连接到SQL Server的其他选项:

http://www.connectionstrings.com/sql-server-2005 [ http://www.connectionstrings.com/sql-server-2008 [
This means that your vb.net application cannot connect to the SQL server. check the connection string (IP, username etc.) & the SQL server is configured to accept remote connections over IP

Check the different options for connecting to sql server:

http://www.connectionstrings.com/sql-server-2005[^]

http://www.connectionstrings.com/sql-server-2008[^]


1.转到``C:\ Windows \ System32 \ drivers \ etc''.
2.使用记事本程序打开主机.
3.取消注释以下行:"127.0.0.1 localhost",或者如果主机条目上没有该行,则添加它.

而已!保存所做的更改并刷新浏览器.

希望这会有所帮助!

*注意-确保对主机"文件具有完全访问权限.

右键单击主机"文件,然后单击属性".
在安全性"选项卡上,单击编辑."按钮.
选择您当前正在使用的用户.
在用户权限"框中,在允许"列上选中完全控制".
然后单击确定"按钮以应用更改.
1. Go to ''C:\Windows\System32\drivers\etc''.
2. Open hosts with Notepad program.
3. Uncomment this line: ''127.0.0.1 localhost'' or add it if it''s not on the host entry.

That''s it! Save the changes you''ve made and refresh your browser.

Hope this helps!

* NOTE - Make sure you have a full access on ''hosts'' file.

Right click on ''hosts'' file then click ''Properties''.
On ''Security'' tab click ''Edit..'' button.
Select the user that you are currently using.
Under ''Permissions for Users'' box, tick ''Full control'' on ''Allow'' column.
And then click ''OK'' button to apply the changes.


这篇关于在网络上连接SQL Server时发生错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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