tags:

views:

273

answers:

2

Excel cannot process data more than 64 bit (Big it will store it in powers of 10), but in our application I want 128bit data, for that I have formatted particular cell to be text format in excel sheet, so that I can enter very big number. Now I am able to enter big number, but not able to read that particular cell in code and also gives error for that cell. I am using OleDbConnection in C#.

A: 

Can you read that cell as a string and then convert it to a biginteger?

C# has no built-in 128-bit integer data type.

Yuliy
It doesn't have a BigInteger type yet either (though it should be in .NET 4), unless you count the J# libary.
Matthew Flaschen
I am reading it as string, but even number is present in that cell, it is no able read (means empty). I am able to read other cells. If the number is less than 14 digits it is able to read, once I enter big number due to which error would come for that particular cell than onwards it is not able to read.
Shashikiran
+3  A: 

You mention that it is some sort of card ID, which to me says it's a string rather than a true number.

But, if you really have to manipulate as an integer, have you looked at BigInteger?

BigInteger, GetFiles, and More

Update in response to comments: @Shashikiran: you seem to be treating the symptoms rather than the cause. Your real problem appears to be reading a string longer than 14 chars, when excel is treating the cell contents as a number rather than string (due to all numeric chars). Sounds like you need to tell Excel it's a string rather than a number, I believe you do this by pre-fixing with 'A'

Mitch Wheat
Problem is reading cell itself..
Shashikiran
I already tried all these options. Still the problem is same..
Shashikiran