Oldb Command To Get Data From Excel Sheet Uing Where Cluase
A:
Yes, you can absolutely do this:
select * from [Sheet1$] where [Column1] = 'whatever'
Peter
2010-09-28 15:30:11
thanks peter put it doesnot work
shmandor
2010-09-28 15:33:30
What part doesn't work? Are you getting an exception? Can you post a sample of the select command you're trying to execute? Then I can tailor the answer to your situation ... :)
Peter
2010-09-28 15:36:29
OleDbDataAdapter dr = new OleDbDataAdapter("select * from [" + workSheetNames[i].ToString() + "] where [Column6]='5:21'", con)
shmandor
2010-09-28 15:40:18
Hmm, which part is not working - the selecting or the filtering? Are you getting any data? Are you getting an exception? Do the values in your worksheetNames array have dollar signs at the end of them? Is there really a column labelled "Column6"?
Peter
2010-09-28 15:53:12
Another thought: is it possible that the Jet engine is interpreting your Column6 as DateTime? If so, you might need to write your query like this: select * from [Sheet1$] where [Column6] = #12/30/1899 5:23#
Peter
2010-09-28 15:58:55
thank you peter for your attension
shmandor
2010-09-29 07:12:57