.Net Add Index to Datatable (dataset)(.Net 将索引添加到数据表(数据集))
问题描述
有没有办法在 .Net 中为数据表添加索引?
Is there a way to add an index to a datatable in .Net?
我有一个包含大约 1,100 行的数据表,并且 datatable.select 语句对于内存操作来说似乎有点慢.
I have a datatable holding about 1,100 rows and the datatable.select statement seems a bit slow for an in-memory operation.
推荐答案
搜索时
这将返回一个数据行.并且主键值必须是唯一的,否则会抛出异常.
This will return a datarow. Also the Primary key values must be unique, otherwise an exception will be thrown.
这篇关于.Net 将索引添加到数据表(数据集)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!