c# - 优化将数据保存在程序内
问题描述
我有一张有 2000 行的表。此表的“名称”列是静态的。但其他人是动态的。下表如下:
我可以把这张桌子放在程序里吗?必须使用哪种格式?(类、列表、数据表、结构 Json 等)。
以后我会在桌子上搜索和更新...
谢谢。
解决方案
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.
推荐阅读
- python - 在类中传递函数结果
- r - 如何在 ggplot2 中绘制置信区间极限的虚线?工作室 R
- javascript - javascript全局变量更新不起作用
- c# - Microsoft.AspNet.Cryptography.KeyDerivation 与 System.Security.Cryptography
- session - 当我以新用户身份登录时,userBean 未更新
- javascript - 在 HTML 范围滑块拇指正上方附加当前范围编号
- facebook-graph-api - Instagram API 认证审批 Instagram_basic 资源路由
- android - 如何在浏览器android中创建多个标签活动
- python - 处理文件中的二进制数据时出现负数错误。处理此问题的最合适方法是什么?
- azure - 重新部署 Azure MVC 站点会使“无响应”的服务总线代码再次开始工作。为什么?