I am using MS Excel as my data source. While retrieving data from excel I get column names as F1, F2, F3... rather than A, B, C... (the column names orginally given by excel. e.g. A, B.... ,AA, AB...)
Excel generated column names are only available if you launch an Excel application. If you use Jet or ACE to connect to an Excel file as if it is a database, you can specify that the first row contains headers by adding HDR=yes to the extended properties
section of the connection string. If the first row doesn't contain headers, the column names default to F1, F2, F3 etc.
Excel generated column names are only available if you launch an Excel application. If you use Jet or ACE to connect to an Excel file as if it is a database, you can specify that the first row contains headers by adding HDR=yes to the extended properties
section of the connection string. If the first row doesn't contain headers, the column names default to F1, F2, F3 etc.
priyank.thak...
Member
72 Points
43 Posts
Column Names in Excel
Dec 07, 2011 07:01 AM|LINK
Hi,
I am using MS Excel as my data source. While retrieving data from excel I get column names as F1, F2, F3... rather than A, B, C... (the column names orginally given by excel. e.g. A, B.... ,AA, AB...)
Please help me.
Regards,
Priyank
urenjoy
Star
12139 Points
1818 Posts
Re: Column Names in Excel
Dec 07, 2011 07:14 AM|LINK
In your excel connection string set HDR = YES then first row is taken as column name.
Mikesdotnett...
All-Star
154842 Points
19855 Posts
Moderator
MVP
Re: Column Names in Excel
Dec 07, 2011 07:16 AM|LINK
Excel generated column names are only available if you launch an Excel application. If you use Jet or ACE to connect to an Excel file as if it is a database, you can specify that the first row contains headers by adding HDR=yes to the extended properties section of the connection string. If the first row doesn't contain headers, the column names default to F1, F2, F3 etc.
Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter
sudhalaksh
Participant
815 Points
176 Posts
Re: Column Names in Excel
Dec 07, 2011 07:20 AM|LINK
Hi friend,
Did you try with HDR='Yes' in connection string?
Thanks.
priyank.thak...
Member
72 Points
43 Posts
Re: Column Names in Excel
Dec 07, 2011 08:08 AM|LINK
Hi Mike,
Thanks a lot for the insight. :)
-Priyank