Fire Hand
Fire Hand

Reputation: 26356

Convert number in excel into string?

i'm trying to import an excel file into SQL Server but if any of the column containing number value like "12355484645" and when it's inserted into SQL Server, the value will become "1.05e+010". Beside the methods of adding "'" in front the value or formatting the excel column, how do i convert the format in asp.net code-behind?

Upvotes: 0

Views: 1378

Answers (3)

Cédric Boivin
Cédric Boivin

Reputation: 11341

You can convert your file in xml with xsd.exe tools in visual studio, and deserialize your xml file into a class and work with the class.

Upvotes: 0

Fire Hand
Fire Hand

Reputation: 26356

i have tried several solutions and none of them were work out! Finally, i have my column formatted as General in excel file and it solved my prob!

Upvotes: 1

Cédric Boivin
Cédric Boivin

Reputation: 11341

The reason is because ADO.net guessing of the data type with the first 8 rows, and more.

There is more explication about the problem and how to fix it

Upvotes: 0

Related Questions