We help IT Professionals succeed at work.
Get Started

Cast object on the fly

Russ Suter
Russ Suter asked
Last Modified: 2012-08-25
I'm using the EEPlus library to create Excel documents.


It's very useful but one of the methods uses the data type to format the cell as an int, date, string, etc... This works fine for CLR data types but my dataset needs to be populated with the Sql Data Types because I need to know if it's a type money vs. decimal etc... When I do this the method just writes everything as text so I need a way to cast the parameter when I pass it into the method. If it's a Sql.Money type I need to cast it to a System.Decimal type.

Can anyone tell me how I'd do this on the fly?
Watch Question
Senior Software Developer
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE