Referencing data via the Column Name

11 views
Skip to first unread message

Buda56

unread,
May 23, 2008, 2:04:50 AM5/23/08
to CSVChat
Hi,
Is it possible to reference the data in a row via the column name??

I am importing XLS data from a system reports and a couple of report
add blank columns within the column collection. I read in the column
Headers and cycle through the header names to ensure that the end user
is importing the correct file. Whilst cycling through the headers I
have been able to ignore the empty column header, but when I actually
access the data in the row i have to use the column number (i.e.
cData[1]) which is an issue due to the blank column.

What I would like to be able to do is referecne as
cData["ColumnName"].

Regards..
Peter

shriop

unread,
May 23, 2008, 9:39:53 AM5/23/08
to CSVChat
Yes, you should be able to access the data just fine using column
names as long as you specify Settings.HasHeaders = true. Is there
something that you're running into that makes it seem like you can't
reference the columns by name?

Bruce Dunwiddie

Buda56

unread,
May 24, 2008, 11:43:44 PM5/24/08
to CSVChat
Bruce,
Hi and thanks for the update.
Yes I am reading , the data into an array and passing it to another
routine for validation. Due to the column space issue from the
spreadsheet I cannot always be sure that the column number is correct
hence I would like to use the column name..

Regards..
Peter
> > Peter- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages