与网络相关的SQL错误 [英] A network-related SQL error

查看:52
本文介绍了与网络相关的SQL错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在Visual Studio 2008中使用vb语言构建了一个应用程序,SQL Server 2008作为后端数据库。它的工作正常。但是当我在安装SQL Server 2008 Express以及数据库之后尝试在客户端计算机上安装它时。我收到错误



在建立与SQL Server的连接时发生与网络相关或特定于实例的错误。服务器不是发现或无法访问。

验证实例名称是否正确,并且SQL Server已配置

以允许远程连接。(提供商:命名管道提供商,错误:40 - 无法

打开与SQL Server的连接



我的连接字符串是

Public MyCon As String =数据源= MyServerName;初始目录= MyDbName;集成安全性=真



也可以尝试使用

Public MyCon As String =数据源= MyServerName;初始目录= MyDbName;集成安全性= SSPI



我尝试过:



i试图在TCP配置工具下放置1433端口以及允许它进入Windows防火墙



i在客户端有Win7 PC。



请帮助

Hi all,
i have built an application in Visual Studio 2008 using vb language, SQL Server 2008 as Backend database. its working fine. but when i try to install it on client machine after installing SQL Server 2008 Express as well database. i got an error

"A Network-Related or instance-specific error occurred while establishing
a connection to SQL Server. The server was not found or was not accessible.
Verify that the instance name is correct and that SQL Server is Configured
to allow remote connections. (Provider: Named Pipes Provider, Error:40 - could not
open a connection to SQL Server"

my connection string is
Public MyCon As String = "Data Source=MyServerName;Initial Catalog=MyDbName;Integrated Security=True"

also try with
Public MyCon As String = "Data Source=MyServerName;Initial Catalog=MyDbName;Integrated Security=SSPI"

What I have tried:

i have tried to put 1433 port under TCP\IP in configuration tool as well allow it to windows firewall

i have Win7 in client PC.

Please help

推荐答案

可能是安全性:很少有正常的SQL Server安装使用集成安全性 - 大多数都需要有效的用户名和密码,并且具有特定数据库和允许用户执行的操作。只有本地SQL Express安装通常会允许集成安全性。



请与服务器的DB管理员联系 - 他应该能够提供相关信息来完成连接串。但请,永远不要硬编码连接字符串。它们应存储在配置文件中,以便您的代码不必在开发和发布版本之间进行更改。
Probably it's the security: very few normal SQL Server installations use Integrated Security - most require a username and password that is valid and has the right privileges for the specific database and the actions that user is permitted to do with it. Only local SQL Express installations would normally allow integrated security.

Check with the DB admin for the server - he should be able to give you the relevant information to complete the connection string. But please, never hard code connection strings. They should be stored in config files so that your code doesn't have to change between development and release version.


亲爱的感谢您的回复



i是vb.net编程中的中间人。

所以你可以根据我的场景帮我解决连接字符串。



基本上我想在客户端计算机上实现我的应用程序,但是我只能在其上安装SQL Express Edition。那么我应该在我的应用程序中使用哪个连接字符串,用户可以使用Windows身份验证与数据库连接?



提前感谢。
Dear Thanks for your reply

i am intermediate in vb.net programming.
so can you help me out in connection string according to my scenario.

Basically i want implement my application on client computer, but i can only install SQL Express Edition on it. So which connection string i should use in my application that user can connect with Database with Windows Authentication ?

thanks in advance.


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

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