简体   繁体   English

当我的 PC 成为使用 sql server 的服务器主机时,如何在其他 PC 上发布 VB.net 应用程序

[英]how to publish VB.net Application at other PC as my PC become server host using sql server

i have some question about VB.NET or Visual Studio app.我有一些关于 VB.NET 或 Visual Studio 应用程序的问题。 Alright let me start with app..i completely finished my work with build an app that will store, edit, import and others thing for my app using SQL Server Management Studio, My PC is the host for the server for that app...the app that i publish in my pc work fine and there were no error occur.. But when i copy the published file into others PC and install the app.. the error occur because its can't connect to my server.. how do i publish correctly so that i can install the app for other pc好吧,让我从应用程序开始……我完全完成了我的工作,构建了一个应用程序,该应用程序将使用 SQL Server Management Studio 为我的应用程序存储、编辑、导入和其他内容,我的 PC 是该应用程序的服务器的主机……我在我的电脑上发布的应用程序工作正常并且没有发生错误..但是当我将发布的文件复制到其他 PC 并安装该应用程序时.. 发生错误是因为它无法连接到我的服务器.. 怎么办我发布正确,以便我可以为其他电脑安装该应用程序

Dim conn As New SqlConnection("Server=MYA02W00018;Database=PHMTest;Integrated Security = True")

This is the connection string这是连接字符串

在此处输入图片说明

im sorry i should send this error firstly back then对不起,我应该先发送这个错误

Answer : my bad its because the other pc not join the domain after i join the domain the error occur that the login id from an untrusted domain and cannot be used with integrated authentication .. then i just change server authentication as SQL and windows authentication at SQL Server Management and after that just Integrated Security = True i just need to remove it.. know i already got to login Thanks for helping guys回答:我不好,因为在我加入域后另一台电脑没有加入域,错误发生是来自不受信任域的登录 id 并且不能与集成身份验证一起使用..然后我只是将服务器身份验证更改为 SQL 和 Windows 身份验证在SQL Server 管理,然后只是Integrated Security = True我只需要删除它.. 知道我已经登录 感谢您的帮助

Open installation location of your app.打开应用程序的安装位置。 You will find a file that shares name with your app eg if your app name is biz_monitor, the file will be named biz_monitor.exe.config您将找到一个与您的应用程序共享名称的文件,例如,如果您的应用程序名称是 biz_monitor,则该文件将被命名为 biz_monitor.exe.config biz_monitor as shown in attached image如附图所示

Open that file using text editor eg notepad.使用文本编辑器(例如记事本)打开该文件。 Locate these lines:找到这些行:

  connectionStrings>
            <add name="Biz_monitor.My.MySettings.constring" connectionString="server=myserver_ip;user id=my_username;password=mypassword;database=mydatabase;procedure cache size=50;use performance monitor=True;use usage advisor=True;logging=True;connection reset=True"
                providerName="MySql.Data.MySqlClient" />
           
        </connectionStrings>

Edit: 1. server to ip address of the machine hosting sql server, 2. database to name of your database, 3. user id to your user name 4. Password to password of your sql server编辑:1.服务器到托管 sql server 的机器的 ip 地址,2.数据库到您的数据库名称,3.用户 ID到您的用户名 4.密码到您的 sql server 密码

Then ensure there is no firewall or antivirus blocking your connection.然后确保没有防火墙或防病毒软件阻止您的连接。 Test and give feedback测试并提供反馈

  1. ping the server using it's ip address.使用它的IP地址ping服务器。 Assign static ip'S if you have not done so.如果您还没有这样做,请分配静态 ip。 if ping will work , network connection is established , if not fix network first.如果 ping 可以工作,则建立网络连接,如果不先修复网络。 Then structure your connection string like this: Connstring = "Data Source=" & Server & ";Initial Catalog=" & DbName & ";User ID=" & User & ";Password=" & Pass & ""然后像这样构造你的连接字符串: Connstring = "Data Source=" & Server & ";Initial Catalog=" & DbName & ";User ID=" & User & ";Password=" & Pass & ""

configure your SQL server to use 'SQL Server Authentication'配置您的 SQL 服务器以使用“SQL Server 身份验证”

现在我已经得到了答案,它只是Integrated Security = True我只需要删除它..知道我已经登录了 感谢您的帮助

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

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