简体   繁体   中英

how to select rows from excel sheet in c#

Hi I have written a code to read from excel sheets and query them according to filter set But am stuck at

Select * from [sheetname] where [col] not like '%something%'

How can I write the not part? Rest all query just work fine The one above ignores the not and executes

If you don't have to use ADO and OLE to read your spreadsheet, I would recommend using EP Plus . It's a project that allows you to work with Spreadsheets in a much better OOP paradigm. It also abstracts all of the gotchas that come from the different internal formatting of .xlsx files versus the older .xls files.

Is it just you don't have quotes around %something% ?

Check out this if you want to melt your brain with Excel possibilities (search the comments for 'not like'), and perhaps solve your problem at the same time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM