OleDbAdapter reading column data
I have created a function to read an excel sheet using OLEDb. I can make the connection and read the excel sheet.
With DbDataReader a开发者_JAVA技巧nd a while loop using Read() method I retrieved all cell data from an excel sheet.
I want to check the alignment info of each cell. If a cell is left-aligned, I will pick data from those left-aligned cells.
How can I do that?
Sorry It is a stupid question but I really need it.
Thanks
You can't do that with Excel OleDb provider; cell alignment isn't exposed. The OleDb provider makes the Excel spreadsheet mimic a database table and database columns don't have alignment.
You'll have to use Excel interop if you need to that. See this question for help on that.
精彩评论