1

I am writing a small c# database application that will store sports statistics. There will be about 7 tables in the local sdf file that will store the data. One table for storing the player details, another table to store the game info and another table that will store the the actual stats from the game using the playerid and gameid as foreign keys. I personally see this as a small database as it will only grow by about 30 entries per week. The end result of this is to be about to pull reports out of the collected stats.

I am a little confused as to which way to access the data in the database. Datasets look ok, but when i want queries to access multiple tables or use the WHERE function in the query, things get a little troublesome. I was thinking of just directly accessing the database with out the need for datasets.

Opinions on the best options are appreciated.

Thanks

4

1 回答 1

1

数据集领域相对较旧的技术正在逐渐被实体框架取代。对于任何寻求标准数据访问技术的新开发,实体框架应该是您的主要解决方案。基于模型的选项感觉很像设计器中的数据集(您可以通过将表和关系拖到表面来设计模型),但实体框架也可以直接针对您的代码(EF-CodeFirst)工作,许多人觉得这更好,因为您可以完全控制代码的外观(而且每次保存数据模型时它都不会被覆盖)。

除非您对 3rd 方库开放,在这种情况下,有一些很棒的开源替代品,包括NHibernate和其他一些。

于 2013-12-22T21:09:22.157 回答