简体   繁体   English

Visual Studio 2010安装程序

[英]visual studio 2010 installer

Need some help I have a problem regarding my program using vb10 it was connected to MYSQL Server 2005 i created my final project as an installer when i install it in other computer there was an error. 需要一些帮助我对使用vb10的程序有问题,它已连接到MYSQL Server 2005,当我在其他计算机上安装该项目时,我以安装程序的形式创建了最终项目。 This is the error "A network or instance specific error occured while establishing a connection to SQL Server. The server was not found or was not accessible. Verify the instance name is correct and that SQL Server is configured to allow remote connection (provider: Named Pipes Provider error 40- could not pen a connection to SQL Server")? 这是错误消息“在建立到SQL Server的连接时发生了网络或实例特定的错误。找不到服务器或无法访问该服务器。请验证实例名称是否正确,并且将SQL Server配置为允许远程连接(提供者:命名为管道提供程序错误40-无法建立与SQL Server的连接”)?

i think i have an error in my connection to database this is the code that i used: 我认为我与数据库的连接有错误,这是我使用的代码:

Dim con As SqlConnection = New SqlConnection("Data Source=localhost;Integrated Security=SSPI;" & _
"Initial Catalog=enrollment")

For simplification lets call your local PC computer A and the computer where you want to install computer B . 为了简化起见,请致电本地PC计算机A和要在其中安装计算机B的计算机。 Not sure if you use mySQL or SQL Server but my answer is acceptable for both. 不知道您使用的是mySQL还是SQL Server,但是我的答案都可接受。

What is happening? 怎么了?

Your connection string is telling your program to connect to your his local MySQL in deployed computer B (The part where says Data Source=localhost). 您的连接字符串告诉您的程序要连接到已部署的计算机B中的本地MySQL(数据源=本地主机的部分)。 As the computer B does not have a mySQL fails to make the connection (Error message Named Pipes Provider error 40- could not open a connection to SQL Server). 由于计算机B没有mySQL无法建立连接(错误消息命名管道提供程序错误40-无法打开与SQL Server的连接)。

You have two solutions : 您有两种解决方案

  1. Change your connection string and put the IP of your local PC A . 更改连接字符串,然后放置本地PC A的IP。 The problem is that B probably will have no access to A . 问题是B可能无法访问A。 Probably A is at your home and B at uni. 可能A在您家里, B在uni。 Also you need to configure SQL/MySQL to accept remote connections. 另外,您需要配置SQL / MySQL以接受远程连接。

  2. Install a local SQL/MySQL in the computer B . 在计算机B中安装本地SQL / MySQL。 Then install your DB there (easiest way is restoring a backup so you have tables, data and if you use, store procs, triggers, functions...) 然后在那儿安装数据库(最简单的方法是还原备份,以便您拥有表,数据,如果使用,则存储过程,触发器,函数...)

Go for the second one :-) 去第二个:-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM