tags:

views:

33

answers:

1

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
thanks peter put it doesnot work
shmandor
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
OleDbDataAdapter dr = new OleDbDataAdapter("select * from [" + workSheetNames[i].ToString() + "] where [Column6]='5:21'", con)
shmandor
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
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
thank you peter for your attension
shmandor