在数据表中查找和编辑行 [英] Find And Edit Row In DataTable
本文介绍了在数据表中查找和编辑行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有更好的方法?
Is there a better way of doing this?
For Each row In licenceTable.Rows
If row("DriveKey") = selectedKey Then
row("Location") = selectedLocal
End If
Next
推荐答案
我认为这可能会更快.
I think this might be faster.
licenceTable.DefaultView.RowFilter = "DriveKey = '" + selectedKey + "'"
For Each row In licenceTable.DefaultView
row("Location") = selectedLocal
Next
只需记住在引用
之前将RowFilter设置为空即可.
再次使用默认视图.
Just remember to set the RowFilter to nothing before referencing the
default view again.
licenceTable.DefaultView.RowFilter = Nothing
我相信这已经是根据性能足够好.
祝你好运.如果您找到更好的产品,请与我们分享:)
I believe this one is already good enough as per performace.
Goodluck on you. Please share us if you find a better one :)
这篇关于在数据表中查找和编辑行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文