Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6940447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:45:13+00:00 2026-05-27T12:45:13+00:00

I am reading in values from an XLSX Worksheet and putting them into a

  • 0

I am reading in values from an XLSX Worksheet and putting them into a Data table.

My problem is that I cannot seem to infer the Datatype of the cell so that I can set the Data table’s Column type.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:45:14+00:00Added an answer on May 27, 2026 at 12:45 pm

    Excel has a much looser approach to typing data than C#. For example, numeric values are always doubles. If you use the Value property of the range object (get_Value() in interop, if I recall correctly), Excel will possibly return a (boxed) decimal or DateTime if the cell’s contents and formatting are consistent with those data types.

    If you use the Value2 property, money and date values will be returned as boxed doubles. (The numbers are all stored internally as doubles, so, because Excel doesn’t need to test for whether to convert them, Value2 is slightly faster.)

    So, you could check the type of each value in a column, and choose your data column’s type accordingly. If you want to test whether a column could have a more specific numeric type (float, int, short, byte, etc.), then you’ll also need to check the range of values in that column, and test whether they are integers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am putting values in HashMap. But when I am reading values from that
I have my code that is reading values from a database and then putting
I have an idea that reading values from config files instead of using hard
I am reading some values from a database that is horribly un-normalized (which I
I have a component that is constantly reading a values from a device. Currently
I'm reading timestamp values from SensorEvent data but I can't work out the reference
How does performance for reading/adding values from/to Dictionary(Of String, SomeReferenceType) depend on the number
I'm loading a 8bppIndexed greyscale image into memory and reading the pixel values. The
Im reading values from a file and storing these values in a hashmap, using
I'm opening a CSV file and reading values from it using File.open(filename). So I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.