如何在同一解决方案中为多个项目使用Local数据库? [英] How do I use a Local datbase for serveral Projects in same solution?

查看:77
本文介绍了如何在同一解决方案中为多个项目使用Local数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我正在寻找合适的方法来制作可在同一解决方案中从更多项目访问的数据库(本地)吗?

任何人都可以告诉我如何做到这一点的最好方法。我是否必须制作自己的数据库项目,我可以在其中一个项目中使用本地数据库并将其连接到其他项目。



问候Twan

Hello,

Im looking for right way to make a database(Local) that is accessible from more projects in the same solution?
Can anyone tell me how the best way to do this. do i have to make own database project of can i use local database in one of the projects and connect it to the other projects.

Greetings Twan

推荐答案

您好,



从我对您的问题的理解,您希望能够以相同的方式进行数据库调用在整个解决方案中使用相同的数据库?



如果是,您有3个选项。



1: EF(EntityFramework)

2:DLL作为一个项目,参考和来自其他人的电话

3:Webservice作为一个项目,参考和来自其他人的电话



我会选择EF,这是最简单的我喜欢EF哈哈



祝你好运!
Hello,

From what I understand about your question is you want to be able to make database calls the same way to the same db throughout your solution?

If yes, you have 3 options.

1: EF (EntityFramework)
2: DLL as one project, reference and call from others
3: Webservice as one project, reference and call from others

I would go with EF, it's the easiest and I love EF haha

Good luck!

如果是MS Access或SQLite,请将数据库文件存储在所有应用程序都可以找到和访问的位置,例如%PROGRAMDATA%\YourCompany \YourDatabseFile.ext(与MS SQLServer无关,因为它是Windows服务)。

对于您的应用程序共享并存储在数据库中的Business Objects,创建一个新的类库项目并从其他应用程序中引用它。
In case of a MS Access or SQLite, store the database file in a location which can be found and accessed by all of your applications, e.g. %PROGRAMDATA%\YourCompany\YourDatabseFile.ext(with MS SQLServer that's not relevant, as that is a Windows Service).
For "Business Objects" shared by your applciations and stored in the database, create a new "class library project" and refernce it from the other applications.


这篇关于如何在同一解决方案中为多个项目使用Local数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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