Visual studio 2010:使用数据库的桌面应用程序的正确解决方案组织(也许)

发布于 2024-11-19 14:39:28 字数 1442 浏览 8 评论 0原文

我在这里问不是因为我从未使用过 Visual Studio,而是因为我正在启动一个需要使用数据库的新项目(桌面应用程序)。

虽然我的实验没有以“最好的方式”使用Visual Studio,因为我使用了第三方库或者与IDE集成得不太好的东西,但这次我想以“正确的方式”构建一个项目,但我需要关于应该如何做的建议。

问题:

  1. WPF 构建用户界面
  2. 该程序将处理 MS-Word 的一些文档
  3. 我不介意“数据库”是 XML 或 mysql 或 sqlserver 或 sqlite 数据库,我需要使用它“很容易”(我的意思是没有大问题和类似的事情),关于我可以使用什么类型的数据库的建议很好该
  4. 程序可能需要一种“中央”数据库,该数据库对于所有
  5. 已删除的 文档都是通用的-
  6. 如果我不使用中央数据库,但“每个文档都是一个数据库”(如 sqlite 文件),我应该在我的解决方案中创建一个数据库项目吗?
  7. 我可以使用 SQLServer Express 创建单个文件数据库吗?我认为它与 Visual Studio 集成比与 sqlite 集成更好
  8. 如果我想将数据库表作为类处理,将行作为这些对象的实例处理,我应该使用什么(由微软建议): Linq to Entities,Linq to SQL,我不知道是否还有其他的,可能与 Visual Studio 界面(设计器和类似的东西)很好地集成,可能不需要其他费用
  9. 数据库表需要处理很多布尔值(每张桌子周围都有60+ bools),我应该为每个 bool 创建一个列还是应该构建一个通过位操作处理的列?如果我需要根据此位字段列的值执行复杂的选择查询,在这种情况下会发生什么?
  10. 我在 Visual Studio 中读到,有一些我从未使用过的“项目类型”,例如 Linq to Entities 项目、数据库项目...我应该使用什么?我显然需要一个 WPF 项目,我应该在我的解决方案中添加什么?
  11. Linq to Entites、Linq to SQL 是“模型”(据我所知),哪个是最新的?我读了一些资料,发现 Linq to Entities 是最新的。我需要学习一个模型库,目前我可以学习的最好的模型库是什么(这可能是这些年来对找工作最有用的,我还年轻)。

感谢大家,抱歉,英语不是我的母语(在这种情况下我应该使用的语言非常具体),

如果我想到其他任何内容,我将更新问题

更新1:

抱歉,如果我的问题有点“困惑”,我对所有这些技术感到困惑! 顺便问一下,SQL Server Express 可以在单个文件上创建数据库吗? (就像sqlite一样) 是否有任何关于 MS-Word 实现的包装器(第三方库可以,特别是如果它们是免费的)? (我注意到这并不“美丽”,所有“参考缺失”的东西......)

啊,感谢您的澄清,现在我明白我正在寻找的是实体框架 使用 Linq to Entities

I'm asking here not because I never used visual studio but because I'm starting a new project (a desktop application) that needs to use a database.

While my experiments didn't use visual studio in "the best way", because I used third party libraries or things that weren't very well integrated with the IDE, I would like to build a project in "the correct way" this time, but I need suggestions about how should be done.

Questions:

  1. WPF to build the user interface
  2. The program will handle some documents of MS-Word
  3. I don't mind if the "database" is XML or mysql or sqlserver or sqlite database, I need to work with it "easily" (I mean without big problems and things like that), a suggestion on what type of database could I use it's nice
  4. The program may need a sort of "central" database which is common to all documents
  5. -deleted-
  6. If I don't use a central database but "every document it's a database" (like an sqlite file), should I createa Database project in my solution?
  7. Can I use SQLServer express to create a single file database, I think it's better integrated with visual studio rather than sqlite
  8. If I want handle the database tables as classes and rows as instances of these objects, what should I use (proposed by microsoft): Linq to Entities, Linq to SQL, I don't know if there are others, possibly well integrated with visual studio interface (Designers and things like that) that possibly don't need other fees
  9. Database tables needs to handle a lot of bools (each table has around 60+ bools), should I create a column for each bool or should I build a column that it's handled through bit manipulation? What happens in this case if I need to do complex select queries based upon values of this bit-field-column?
  10. I read in visual studio that there are some "project types" that I never used, like Linq to Entities project, Database project... what should I use? I need obviusly a WPF project, what should I add to my solution?
  11. Linq to Entites, Linq to SQL are "models" (as I know), which is the newest? I read something around and I understood that Linq to Entities it's the newest. I need to study one model library, what's the best one that could I study at the moment (which could be the most useful in these years also to get a job, I'm young).

Thanks to everyone and sorry but english is not my native language (and the language that I should use in this case is quite specific)

I will update the question if anything else will come in my mind

Update 1:

Sorry if my question were a bit "confused", I'm confused about all these technologies!
By the way can SQL Server Express create a database on a single file? (like sqlite does)
Are there any wrapper about MS-Word implementation (3rd party libraries are ok, expecially if they are free)? (I noticed that is not "beautiful" with all "ref missing" things...)

Ah and thanks about clarification, now I understood that what I was looking for is Entity framework
with Linq to Entities

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

墨小沫ゞ 2024-11-26 14:39:28
  1. WPF 是一个不错的选择 - 大多数开发人员会在新项目中选择 WPF,而不是更传统的 WinForms。
  2. MS-Word 文档的处理很好 - 有可用的互操作 API 和各种文章解释 以编程方式与 MS-Word 交互的各个方面
  3. 根据您的要求,您可以选择客户端 SQL 紧凑型数据库,或者让您的应用程序与服务器端组件进行交互。 SQL Express 可以在服务器端使用,并允许您在将来根据需要升级到更方便的版本。
  4. 请参阅有关服务器端数据库存储的第 3 点
  5. 很难理解您的意思
  6. 如果没有“中央数据库”,那么您不需要
    数据库项目。如果有一个“中央数据库”仍然存在
    没有实际需要有一个数据库项目。
  7. 是的,可以使用 SQL Server Express 并与 Visual 集成
    Studio 通过使用服务器/数据资源管理器和各种其他方式轻松实现
    VS 模块。
  8. Linq to Entities 不是 ORM。 Linq to SQL 是,实体也是
    框架 4. 有许多可用的 ORM - 非常简短
    摘要 我发现 Linq to SQL 最适合快速开发,并且
    实体框架(更复杂且更方便)
    更适合更大的解决方案。有很多选择。
  9. 我从来没有在一个表中处理 60 个布尔值 - 它可能
    值得考虑你的设计。谷歌搜索“数据库
    标准化”并阅读有关该主题的教程以确保您的
    在继续此处之前,设计是正确的。如果 60 个布尔值是
    需要的话,我会将它们保留在数据库中以便于使用
    维护。
  10. 这取决于您设想的解决方案有多大。我
    建议在 google 中搜索“N-Tier Applications”以获得
    总体概述。
  11. 看看
    此处< /a>
  1. WPF is a good choice - most developers will opt for WPF in a new project as opposed to the more legacy WinForms.
  2. The handling of MS-Word documents is fine - there is interop API available and various articles explaining the various aspects of programmatically interacting with MS-Word
  3. From your requirements you could either opt for Client Side SQL Compact Databases, or have your applications converse with a server side component. SQL Express can be used server side and allows you to upgrade to a more facilitating edition in the future if needs be.
  4. See point 3 regarding Server Side Database Storage
  5. Difficult to work out what you mean here
  6. If there is no "central database" then you should not need a
    database project. If there is a "central database" there is still
    no actual need to have a database project.
  7. Yes, SQL Server Express can be used and integrates with Visual
    Studio easily by use of the Server/Data Explorer and various other
    VS modules.
  8. Linq to Entities isn't an ORM. Linq to SQL is, as is Entity
    Framework 4. There are many ORM's available - as a very brief
    summary I have found Linq to SQL Best for Rapid Development, and
    Entity Framework (both more complex and more facilitating) to be
    better for larger solutions. There are many alternatives.
  9. I've never had to deal with 60 Booleans in a single table - it may
    be worth considering your design. Google for "Database
    Normalisation" and read tutorials on the subject to be sure your
    design is correct before continuing here. If the 60 Bools are
    required, I would keep them as such in the database for ease of
    maintenance.
  10. This depends on how large you envisage your solution becoming. I
    would recommend searching google for "N-Tier Applications" to get a
    general overview.
  11. Take a look
    here
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文