首页 > 解决方案 > 优化将数据保存在程序内

问题描述

我有一张有 2000 行的表。此表的“名称”列是静态的。但其他人是动态的。下表如下:

在此处输入图像描述

我可以把这张桌子放在程序里吗?必须使用哪种格式?(类、列表、数据表、结构 Json 等)。

以后我会在桌子上搜索和更新...

谢谢。

标签: c#classstruct

解决方案


You can easily put your row data into a MyRow class with Id, Position, Weight and FullEmp properties and then put those row objects into a list of rows like List<MyRow>.

Performance considerations largely depend on what you want to do with your data. How often do you read it? How often do you change it? How often do you insert, append or remove rows? Which properties do you access during your search?

A list is a good starting point that you can use until you find out that the performance is unsatisfactory for your usecase.


推荐阅读