Skip to content
标签
欢迎扫码关注公众号

C# 如何使用 linq 操作 DataTable?

调用 DataTableAsEnumerable 方法,使其支持 Linq

下面的代码返回 DataTableGuid 列的 string 数组。

csharp
(from dr in dt.AsEnumerable() select dr.ToString()).ToArray<string>();

项目添加引用 System.Data.DataSetExtensions

去重复

csharp
(from dr in dtLineGroup.AsEnumerable() select dr.ToString()).Distinct().ToArray()

Page Layout Max Width

Adjust the exact value of the page width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the page layout
A ranged slider for user to choose and customize their desired width of the maximum width of the page layout can go.

Content Layout Max Width

Adjust the exact value of the document content width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the content layout
A ranged slider for user to choose and customize their desired width of the maximum width of the content layout can go.