|
-
Aug 7th, 2003, 11:42 AM
#1
Thread Starter
Fanatic Member
datagrid
A win datagrid is populated by a dataset.
This dataset varies for each population. i.e sometimes 4 fields and sometimes more or less...
I would like to transfer this dataset and populate it into excel sheet.
How can a dataset or the data in a datagrid be transfered into excel sheet.
If I was using a DataReader I know how to loop through it and populate the excel sheet but with the Dataset I do not know
Thanks
-
Aug 8th, 2003, 04:13 AM
#2
Lively Member
you can loop through a dataset like this :
a dataset exists of one or more datatables so let's assume you have only one table in it.
you can do this :
dim dt as datatable = ds.tables(0)
dt.rows.count (so you know the qty of rows in table with index 0.)
for i=0 to dt.rows.count
dt.rows(0)(i) '-> this gives you row by row from column0
next
This code is untested but it will help you for sure !
HTH
Bjorn
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|