如果我有SQL Server,如何进行发布 [英] How i can make publish if i have SQL Server

查看:84
本文介绍了如果我有SQL Server,如何进行发布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好
我在项目中遇到了一个大问题,我完成了它.但是,当我在PC上发布程序时,该程序正常工作,但是当我将其复制到另一台PC上时,我会看到很多消息
-------------
错误连接40
错误26
-------------
我需要在另一台PC上运行程序,不需要本地程序和数据库,而无需Internet和本地主机
我有数据网格视图和数据集
请帮帮我.
thx

Hello
I have a big problem in my project , I finished it .But, when I publish in my PC the program is worked but when I copy it to another PC I see many massages
-------------
error connection 40
error 26
-------------
i need run my program on another pc i dont need local just program and database without internet and local host
i have data grid view and dataset
Help me please .
thx

推荐答案

如果我对您的理解正确,则您的应用程序在一台PC上运行良好,但是当您在另一台PC上运行该exe时,它将无法运行. >
仔细检查您提供的错误详细信息,看来问题出在连接字符串上.

如果使用的是Windows身份验证,则应用程序将无法连接到另一台计算机上的数据库.

相反,您需要使用Sql身份验证(检查是否已以混合模式安装Sql Server)并使用用户名和密码凭据

数据源= myServerAddress;初始目录= myDataBase;用户ID = myUsername;密码= myPassword;

使用serverName \ instanceName作为数据源连接到特定的SQL Server实例.

上面的连接字符串适用于sql server2008.

希望这对您有所帮助.让我知道,如果您还有问题.

欢呼
If I have understood you correctly, your application is running fine in one PC but when you run the exe in another PC it fails to run.

Going through the error details you have provided, it seems, the problem lies in connection string.

If you are using Windows Authentication, then application will not connect to database residing on another machine.

Instead, you need to use Sql Authentication(check, if you have installed Sql Server in mixed mode) and use the user name and password credential

Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

Use serverName\instanceName as Data Source to connect to a specific SQL Server instance

The above connection string is for sql server 2008.

Hope this helps you. Let me know, if you still have issues.

cheers


好吧,我想您有2台通过tcpip连接了.

试试这个
数据源= 192.168.1.1,1433;网络库= DBMSSOCN;初始目录= myDataBase;用户ID = myUsername;密码= myPassword;

您需要获取安装了sql server的PC的IP.
在运行命令中使用ipconfig获取IP,或者您可以从控制面板网络设置获取IP.在连接字符串中使用ip.

希望这会有所帮助.

欢呼
Well, I guess, you have 2 pcs connected through tcpip.

Try this
Data Source=192.168.1.1,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;

You need to get the ip of the pc where the sql server is installed.
use ipconfig in run command to get the ip or you can get it from control panel-network settings. Use the ip in the connection string.

Hope this helps.

cheers


您创建并部署了哪种应用程序?您的数据库实例位于域还是本地系统中?
如果您已经创建了Windows窗体应用程序,并且您的数据库实例是本地的,那么除非您在其中提供用户角色,否则其他实例将无法访问.

请详细说明您的问题.
What kind of an application you have created and deployed? Is your data base instance reside in the domain or in your local system?
If you have created windows forms application and your db instance is local, then others wouldn''t be able to access unless you provide user roles in it.

Please elaborate your problem.


这篇关于如果我有SQL Server,如何进行发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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