Can we execute a query on DataTable

datatable
database

#1

Hi,

I am loading the data from excel to Datatable.

Can we use the DataTable as a database and execute the Select query.


#2

You can use DataTable.Select, however that will give you the results in DataRow Array.

Check this,

Thanks,
Rammohan B.


#3

Then you can convert the DataRow Array returned by the Select method to a new DataTable using the CopyToDataTable extension method. Please check this post on forum about this method.