Sql Query on a datatable

  • Thread starter Thread starter Tomer
  • Start date Start date
T

Tomer

Hi,

I have a datatable filled with data, and I need to fill another datatable
from it by using a sql query. is this possible? if not was is the best (
fastest ) way to do this. In the select query I need to use the 'group by'.

Thanks, Tomer!
 
Do you mean DataTable class in System.Data?
If so, you can not use SQL with it (unless you're willing to write your own
SQL query processor).

However, you can select and filter records in the DataTable with SQL-like
queries.
Look into DataTable.Select() method to do that.
Also consider using DataView class which allows you to create sorted and
filtered views of your data without creating a copy.

Finally, you can use SQL CE which would allow you to execute actual SQL
queries.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
 
Back
Top