Val Nolav
Val Nolav

Reputation: 902

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 and 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

Upvotes: 2

Views: 306

Answers (1)

shf301
shf301

Reputation: 31394

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.

Upvotes: 1

Related Questions