如何在未安装SQL Server的另一台PC上运行用C#编写的SQL Server 2005数据库应用程序? [英] How can i run a SQL server 2005 database application written in C# on another PC having SQL Server not installed ?

查看:106
本文介绍了如何在未安装SQL Server的另一台PC上运行用C#编写的SQL Server 2005数据库应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C#上创建了一个数据库应用程序,并在笔记本电脑上安装了SQL Server 2005 Databse.它正在我的笔记本电脑上运行,但我想在另一台PC上运行.

是否可以在未安装Databse服务器的PC上运行数据库应用程序?

如果有可能,那怎么办呢?

希望您早日得到答复...?

问候,

Ahmed Khan

I have made a database application on C# and have a SQL Server 2005 Databse installed on my laptop. It is running on my laptop but i want to run it on another PC.

Is it possible to run a database application on a PC having Databse server not installed ?

If it is possible then how can it be done ?

Looking forward your early reply... ?

Regards,

Ahmed Khan

推荐答案

艾哈迈德,

您将必须更新连接字符串,通常是.config文件中的字符串.

有关连接字符串的更多详细信息,请访问http://www.connectionstrings.com

注意:Sql服务器应安装在局域网上可访问的至少一台计算机上.

谢谢
Hi Ahmed,

you will have to update the connection string, commonly its in .config file.

for more details on connection string please view http://www.connectionstrings.com

Note: Sql server should be installed on at leaset one machine accessiable on LAN.

thanks


首先:确保您的sql服务器正在作为Network service工作.如果不是Nerwork服务,则将其设置为网络服务.
为此,请运行"SQL Server配置"并选择
SQL Server 2005服务,在SQL Server(您的服务器名称)上单击mouse2->属性,
选择网络服务

第二个:启用TCP/IPShared Memory.为此,请运行SQL Server配置管理器,选择
SQL Server 2005网络配置-> {UR服务器名称}的协议
然后启用TCP/IP&共享内存.

第三更改您的应用程序的连接字符串.连接字符串应类似于
First :Make sure that your sql server is working as a Network service. If it isn''t Nerwork service then make it Network service.
To do this, Run "SQL Server Configuration" and select
SQL Server 2005 Services, click mouse2 on SQL Server(Ur server name) -> properties,
select Network Service

Second :Enable TCP/IP and Shared Memory. To do this, run SQL Server Configuration manager, select
SQL Server 2005 Network Configuration -> Protocols for {UR server name}
and then enable TCP/IP & Shared memory.

Third Change connection string of your applicaton. The connection string should be like
Data Source=server_computer_name;Initial Catalog=data_base_name;User ID=sa


如果您的服务器有密码,请提供密码.看起来像


If ur server has pasword then provide it. Looks like

Data Source=server_computer_name;Initial Catalog=data_base_name;User ID=sa; Password=your_pass


这是一个Sqlconnection.如果您使用不同的连接方法,则取决于.

希望它能对您有所帮助:)


This is a Sqlconnection. If u r using different method of connection then it depends on.

Hope it will help you :)


我不太喜欢您给出的答案.没有SQL Server,您将无法运行SQL Server数据库.如果您的数据库很小,则可以看看不需要安装SQL Server的SQL Server compact,该数据库从与应用程序一起部署的dll运行.我相信有人提到过,另一种选择是通过网络连接到SQL Server,但是核心答案是,除非您使用Compact Edition,否则必须安装SQL Server并在软件运行时对其可见.它所在的位置.
I don''t really follow the answers you''ve been given. You cannot run a SQL Server database without SQL Server. If your DB is small, you could look at SQL Server compact, which doesn''t require SQL Server installed, the DB runs from dlls that you deploy with the app. The other option, which I believe someone did mention, is to connect to your SQL Server over a network, but the core answer is, SQL Server needs to be installed and visible to the software when it runs, unless you use the Compact Edition, where it''s self contained.


这篇关于如何在未安装SQL Server的另一台PC上运行用C#编写的SQL Server 2005数据库应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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