Link to home
Start Free TrialLog in
Avatar of rwheeler23
rwheeler23Flag for United States of America

asked on

How to determine column type in Excel file using C#

I have created a C# program to read an Excel file and insert records into SQL. Every now and then it fails and it fails because one of the columns is not defined the same as in all the other files. This particular column contains a 14 digit string of digits. Most times it is defined in Excel as number but every now and then it is defined as text. Is there a way using C# to determine the type of a column or cell so I can adjust the code to convert one way or the other?
ASKER CERTIFIED SOLUTION
Avatar of Ares Kurklu
Ares Kurklu
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rwheeler23

ASKER

They are supposedly using the same template over and over again. I noticed this when I was ding the import manually using SSMS.
Thanks