简体   繁体   English

SDF和MDF,一个应用程序中的两个数据库

[英]SDF and MDF, two database in one application

Is it possible to use two databases in one application, ie SQL Server database and Local Database ( .sdf = SQL Server Compact Edition)? 是否可以在一个应用程序中使用两个数据库,即SQL Server数据库和本地数据库( .sdf = SQL Server Compact Edition)?

So some user can use it on network, but for another users is that not important. 因此,某些用户可以在网络上使用它,但是对于其他用户而言,这并不重要。

Can I create two project, one for SQL Server for example (I have already LINQ to SQL). 我可以创建两个项目,例如一个用于SQL Server的项目吗(我已经有LINQ to SQL)。 And another for Local Database where .sdf file is added with DataSet and so on. 另一个用于本地数据库,其中.sdf文件与DataSet一起添加,依此类推。 And than I planned to compile my solution including one of this two project, depends on my customer's needs (SQL Server or Local Database). 而且,比我计划编译包括这两个项目之一的解决方案的计划还要取决于客户的需求(SQL Server或本地数据库)。 I have also Business Layer and GUI which stay the same. 我还有业务层和GUI,它们保持不变。 Can this be done or there is some other way how to do this? 可以做到这一点,还是有其他方法可以做到这一点?

I am using Visual Studio 2012 我正在使用Visual Studio 2012

Thanks for any tips. 感谢您的提示。

Compact is not fully compatible with "real" SQL Server. Compact与“真实” SQL Server不完全兼容。 Check the LocalDB instead: supports everything that express edition does, but simplified setup and doesn't run as a windows service. 而是检查LocalDB:支持Express Edition所做的所有事情,但是简化了设置并且不能作为Windows服务运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM