gpt4 book ai didi

c# - 如何从数据表中选择所有行

转载 作者:行者123 更新时间:2023-11-30 20:28:03 26 4
gpt4 key购买 nike

我似乎无法弄清楚如何在 DataTable 上使用 Select 时只返回所有行。

到目前为止我的代码:

foreach (DataRow r in data.Select("Sort != null", "Sort"))
{ //process }

我收到以下错误:

Cannot interpret token '!'

Sort 列是 Guid 类型,用于以随机顺序返回行。

最佳答案

试试这个...

foreach (DataRow r in data.Select("Sort IS NOT NULL", "Sort"))
{ //process }

关于c# - 如何从数据表中选择所有行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47898834/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com