Window应用程序也访问本地数据库和服务器数据库,但一次只能访问一个源 [英] Window application access local database and server database too but one source at a time

查看:84
本文介绍了Window应用程序也访问本地数据库和服务器数据库,但一次只能访问一个源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。



我想在.net框架的Windows应用程序上启动一个项目。



但问题是有些客户希望他们从服务器访问数据库而其他客户希望他们从本地访问数据库。



所以,请你帮帮忙我,如何通过一个窗口应用程序满足客户的要求..





提前致谢。

Hi all.

I want to start a project on windows application of .net framework.

But the problem is that some client wants that they access the database from server and other client wants they access database from its local.

So, will you please help me, how can i meet the requirement of client through one window application..


Thanks in advance.

推荐答案

当代码需要访问数据库时,您必须提供连接字符串。该连接字符串告诉如何访问数据库,包括服务器的名称。因此,无论是本地还是服务器都无关紧要,您所要做的就是提供正确有效的连接字符串。



http://www.connectionstrings.com/ [ ^ ]
When code needs to access a database you have to provide a connection string. That connection string tells how to access the database including the name of the server. Therefore, it does not matter if it is local or on a server, all you have to do is provide a correct and valid connection string.

http://www.connectionstrings.com/[^]


这篇关于Window应用程序也访问本地数据库和服务器数据库,但一次只能访问一个源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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