How can I reffer a column in my query when using excel old db provider?
-
Saturday, August 11, 2012 3:27 AM
May be the most basic question but I got stuck when during data generation data bound process I have to reffer to a specific column say D in my Sheet2. I can get all Columns in Sheet2 by using Select * from [Sheet2$] but when I have to reffer to Column D I tried Select D$ from Sheet2$ but it did not work.
Can anyone tell me what should be the exact syntext?
Nilkanth S. Desai
All Replies
-
Sunday, August 12, 2012 3:52 AM
Select D from [Sheet2$]
Should work fine.Lingaraj Mishra
-
Sunday, August 12, 2012 5:30 AM
Hello Mishraji,
Thanks for your reply. I try u r suggestion with one more alternative also as Select D$ from [Sheet2$] but it did not work. Thanks for u r answer.
Nilkanth S. Desai
-
Monday, August 13, 2012 2:01 AMModerator
Hi Nikanth,
Welcome to MSDN Forum.
@Lingaraj's solution should work, is there an exception thrown, or the data isn't your expected?
Best Regards
Allen Li [MSFT]
MSDN Community Support | Feedback to us
- Edited by Allen Li - AI3Microsoft Contingent Staff, Moderator Monday, August 13, 2012 2:01 AM
-
Tuesday, August 14, 2012 3:39 PM
If you are not using a header in the Excel Worksheet to identify the column names, then the default column names are F1, F2, F3, etc.Paul ~~~~ Microsoft MVP (Visual Basic)
- Proposed As Answer by Val MazurModerator Wednesday, August 15, 2012 4:40 PM
- Marked As Answer by Allen Li - AI3Microsoft Contingent Staff, Moderator Monday, August 20, 2012 2:14 AM

