Error choosing from datatable and copying datatable

I tried to sort the data. To do this, you sort it and then copy the sorted into datatable, as shown here - How to query a DataTable in memory to populate another data table

code -

DataTable table = GetDataTableResults(); DataTable results = table.Select("SomeIntColumn > 0").CopyToDataTable(); 

In the visual studio, I see a mistake -

 'System.Array' does not contain a definition for 'CopyToDataTable' and no extension method 'CopyToDataTable' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?) 

How to fix it?

0
source share
2 answers

Add a link to System.Data.DataSetExtensions.dll in your project.

How to Add or Remove Links Using the Add Link Dialog Box

+2
source

What structure are you using? If I am not mistaken, CopyToDataTable is supported only in the version. 3.5 and higher.

+1
source

Source: https://habr.com/ru/post/895337/


All Articles