Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET Excel
My excel is in following format. i am importing it in asp.net application by using
OleDbCommand cmd = new OleDbCommand("SELECT * FROM [" + sheet + "]", conn);
Date Loan Borrower Fees Interest
07-05-2012 4.536E+17 Srinibas1 50.00 350.00
07-05-2012 4536000002 Srinibas2 50.00 351.00
07-05-2012 4536000003 Srinibas3 50.00 352.00
 
then inserting it in dataset
output.Tables.Add(outputTable);
          new OleDbDataAdapter(cmd).Fill(outputTable);
MY PROBLEM IS i want to read all column as string and command read EXPONENTIAL format. how can i get rid of exponent while diplayin record in gridview.
 
any help is much appreceiable.
Thanks
Posted 1-Aug-12 3:04am
Edited 1-Aug-12 18:56pm
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

See if following discussion helps you:
excel-to-datagrid-exponential-issue[^]
  Permalink  
Comments
pradiprenushe at 2-Aug-12 1:57am
   
My 5. Link provided by Chasfer also very useful in such scenario.
Vani Kulkarni at 2-Aug-12 3:57am
   
Thanks Pradip
Gufran_khan at 2-Aug-12 4:32am
   
thanks but none of them worked. the value i am importing is an ID so i want exact value and conversion in dotnet doesnot convert it in same value as it was in excel.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Comments
pradiprenushe at 2-Aug-12 1:56am
   
Very good link. My 5
Gufran_khan at 2-Aug-12 4:33am
   
thanks for your response but I am importing excel into asp.net application and article is about exporting data from app to excel.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 450
1 OriginalGriff 393
2 Sergey Alexandrovich Kryukov 229
3 CPallini 189
4 CHill60 180
0 OriginalGriff 6,092
1 Sergey Alexandrovich Kryukov 5,022
2 Maciej Los 3,269
3 Peter Leow 3,164
4 DamithSL 2,490


Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 2 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100