将数据库附加到.exe windows应用程序中 [英] Attach a database into .exe windows application

查看:123
本文介绍了将数据库附加到.exe windows应用程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好b $ b

我正在使用c#,sql server2012开发一个Windows应用程序项目。现在我想在其他计算机上运行此应用程序。怎么可能?? ..现在我从我的系统备份数据库并将其恢复到我想安装我的exe的系统。但这在所有时代都是不可能的。因为无法在所有系统中恢复此数据库,并且无法始终将程序中的连接字符串更改为当前系统服务器名称。任何人都可以说任何解决这个问题的方法??我怎么能用数据库制作exe?我正在使用安装盾创建setupfiles。

谢谢

Hi
I am developing a windows application project using c#, sql server2012. Now I want to run this application in other computer. How it possible??.. Now I am taking backup of database from my system and restore it into the system which I want to install my exe. But It is not possible in all the times. Because restoring this database into all the systems and also changing the connection string in program as the current system servername are not possible in all the times. can anyone say any solution to this problem??How can i make exe with database?? I am creating setupfiles using install shield.
Thanks

推荐答案

这是一个非常非常糟糕的主意。



SQL Server是一个多用户系统,它要求安装SQL Server以供所有想要使用数据库的计算机使用 - 而这不是普通用户应用程序可用。此外,将SQL Server用于单用户数据库是一个非常糟糕的主意 - 因为每个用户可能想要自己的数据副本而不是共享它。所以如果你在同一个办公室安装你的软件的两个用户...其中一个会非常沮丧...



如果你想要一个用户数据库,然后使用单个用户数据库:SQLite,SQLCE,甚至Access。

如果你想要一个多用户数据库,那么你想做的最后一件事就是尝试用每个应用程序安装你的数据库。你甚至不知道局域网上有一个SQL安装......
That is a really, really poor idea.

SQL server is a multiuser system, which requires an installation of SQL Server to be available to all computers that want to use the database - and that is not a "normal user" application to have available. In addition, using SQL Server for single user databases is a spectacularly bad idea - as each user will presumably want their own copy of the data rather than to share it. So if you get two users in the same office installing your software...one of them is going to get very upset...

If you want a single user database, then use a single user database: SQLite, SQLCE, or even Access.
If you want a multiuser database, then the last thing you want to do it blindly try to install your database with each application. And you don;t even know there is an SQL installation on the LAN segment...


这篇关于将数据库附加到.exe windows应用程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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