If he's using .Net 2.0, can't he use the .ToTable with a DataView to make a
new table of selected items?
'tblAllCustomers is a DataTable with all [Customers] records from Northwind
'Create a dataview for spanish customers
Dim dv as New DataView(tblAllCustomers)
dv.RowFilter = "Country = 'Spain'"
'create a new data table based on the DataView
Dim tblSpanishCustomers As DataTable = dv.ToTable("SpanishCustomers")
Console.WriteLine("TableName: {0}", tblSpanishCustomers.TableName)
Console.WriteLine("Rows:")
For each row as DataRow in tblSpanishCustomers.Rows
Console.WriteLine(" {0}, {1}", row("City"), row("Country"))
Next Row
So if this works, could he do this, and then add the datatable to the
dataset, or even create the datatable inside the dataset?
Robin S.
-------------------------------------------------------------
I would
Instantiate a new Table object
Walk the Table(n).Columns collection and clone the desired columns
Add these selected columns to the new Table object's Columns collection
Add the newly configured table to the DataSet.Tables collection
hth
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit
www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------