简体   繁体   English

VB.NET应用程序与SQL Server Express

[英]VB.NET application with SQL Server Express

I am developing simple application using VB.NET and SQL Server Express. 我正在使用VB.NET和SQL Server Express开发简单的应用程序。

The application runs well and has full functionality on the PC I developed (that has both SQL Server and vb.net installed). 该应用程序运行良好,并且在我开发的PC上具有完整的功能(已安装SQL Server和vb.net)。 The problem is, when I try to install another computer I get an error: 问题是,当我尝试安装另一台计算机时出现错误:

Cannot open database "DatabaseName" Requested by the login. 无法打开登录请求的数据库“ DatabaseName”。 Login failed. 登录失败。
Login failed for the user "UserNameOfTheComputer" 用户“ UserNameOfTheComputer”的登录失败

Please see the images: 请查看图片:

[Error][1] [错误] [1]

And please advice what is the best way that customer can use offline application developed in VB.NET 并请告知客户使用VB.NET中开发的脱机应用程序的最佳方法是什么

Thanks in advance 提前致谢

Are you using localhost server or actually pointing to network server? 您正在使用本地主机服务器还是实际上指向网络服务器?

If you are pointing to network server, add the PC-name or IP of the server before the SQL server name. 如果您指向网络服务器,请在SQL服务器名称之前添加服务器的PC名称或IP。 eg : 192.168.1.200/SQLSERVER instead of localhost/SQLSERVER 例如:192.168.1.200/SQLSERVER而不是localhost / SQLSERVER

我猜在您的开发计算机中,您正在使用本地SQL Server(SQL Server和Visual Studio在同一台计算机上),因此要在客户端PC中使用它,您需要将客户端PC与SQL Server一起安装并设置.exe客户端PC Sql Server.for和脱机的.config连接字符串,并且可能脱机,您可以尝试从Visual Studio本身构建内置数据库。

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

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