In the Introduction, I pointed out that the DataTable has a method which is similar to the WHERE clause in TSQL.
This method (Select) returns an array of DataRow's that meet the criteria of your expression.
To bring this method in line with our other operators in returning a DataTable, a simple helper method is used.
public static DataTable RowsToTable(DataRow
DataTable table = new
column in Rows.Table.Columns)
row in Rows)
public static DataTable
Restrict(DataTable Table, string WhereClause)
If you have stuck with this series of posts, I have one more post to go, then I am done.
It will be looking at the practical implementations of these methods against the Northwind database.
| posted on Wednesday, January 28, 2004 1:45 PM