petre ricardo

petre ricardo

  • NA
  • 194
  • 0

Creating Custom Data Tables?

Oct 7 2009 3:23 AM

hi
i want to create my own Datatable (i.e.: with my own column header names) therefore i ahve followed the following lines:
 

DataTable t = new DataTable()
t.Columns.add("Index")
t.Columns.add("Name")
 

 
The a Dataset "ds" returns a table that has two four columns custIndex, CustName, CustLocation and CustCreditLimit. I only need to load the first two columns, custIndex as CustName to the create table above.
I tried read the rows in the dataset's table then used the following to create the row
foreach (read reach row in the Dataset table)
{

   t.NewRow()
}

 
But i dont know how to load the data in the dataset's table to the created row, how to i do it?
TY

Answers (1)