如何在App.Config文件中设置连接字符串? [英] How Can I Set Connection String In App.Config File?

查看:67
本文介绍了如何在App.Config文件中设置连接字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序就像一种类型的帐单项目。在这个项目中我使用sql server management studio 2008来存储和检索data.now我想在不同的计算机上安装。我可以用这个数据库安装这个项目吗?

这是必须的在每台计算机上安装sql server management studio 2008?如果是,那么如何在app.config文件中设置连接字符串。

i have one application just like one type of bill project. in this project i am using sql server management studio 2008 for storing and retrieving data.now i want to install on different-different computer.how can i install this project with this database?
is this mandatory to install sql server management studio 2008 on each computer?if yes then how can i set connection string in app.config file.

推荐答案

你不需要SQL Server管理Studio在机器上,但您需要SQL Server。 Management Studio只是管理SQL Server的用户界面。



其次,如果您的应用程序连接到SQL,则不需要在所有计算机上安装SQL Server服务器通过网络(内联网/互联网),你可以只与一个SQL Server通信。



我认为第二个是你可能想要的那个,否则它不会有意义的是为每个应用程序实例提供SQL Server。



查看MSDN文档以了解如何在配置文件中使用连接字符串:



http:/ /msdn.microsoft.com/en-us/library/ms254494(v=vs.110).aspx [ ^ ]
You don't need SQL Server Management Studio on the machine but you need SQL Server. Management Studio is just the user interface to manage SQL Server.

Second, you don't need SQL Server on all the machines if you your application is connected to the SQL Server via network (intranet/internet) and you can just communicate to one SQL Server.

I think the second is the one you probably want as well otherwise it does not make sense to have SQL Server at all for every single instance of application.

Look at the MSDN documentation to understand how you can use Connection String in config files:

http://msdn.microsoft.com/en-us/library/ms254494(v=vs.110).aspx[^]


这篇关于如何在App.Config文件中设置连接字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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