473,320 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

loseing (exact) number format while uploading in .csv file in response.write method

Using Response.Write() method to export table data in .csv format. In the table one column is of number type and its length is up to 20 digits. When uploading data into .csv format its eleminating digits after 15th digit and placing 0 values till the end. And showing in exponasial formate number.
ex- actual no - 12345678901234567890
saving as - 12345678901234500000
Is there any way to formate column or cell using Response.write for .csv file.

Thanks in advance.
Sep 12 '08 #1
4 3210
Plater
7,872 Expert 4TB
I would guess that since that number is so large is gets truncated? Might be implicitly casted as a Double? Make sure you are using a UInt64 to hold the number maybe?
Sep 12 '08 #2
Thanks for your response Plater.

I am converting totally into string format. And then writing it into file through Response.Write(). Actually value which is getting through application is same and correct value. But because of excel(.CSV) default settings value is formating to exponansial format value. i am unable to change .csv settings through inbuilt Response method before writing into it.
Sep 16 '08 #3
Plater
7,872 Expert 4TB
If the problem is with how excel reads the values, I don't think there is anything you can do in code.
Have you resized the width of the columns in excel? I find that when they are narrow, excel converts long numbers into scientific notation.
Sep 16 '08 #4
balabaster
797 Expert 512MB
If you open the CSV in Notepad, you will likely see that the data stored in the CSV is correct. It is just how Excel is displaying the data that is incorrect. The easiest way around this is to change the formatting of the incorrect columns in Excel itself. If you were to save to Excel's native format instead of CSV, you could save the column formats too. This would alleviate the problem - but then you've got the added overhead in your code of creating a native Excel document and setting the column formats etc.
Sep 16 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Kevin Ollivier | last post by:
Hi all, I've come across a problem that has me stumped, and I thought I'd send a message to the gurus to see if this makes sense to anyone else. =) Basically, I'm trying to upload a series of...
4
by: M P | last post by:
Can you help me find an asp code that will upload a file from my PC to web server? Mark
0
by: FusionGuy | last post by:
I've created a file uploading handler, implemented as an httpHandler. Each time I attempt to upload a file, or files, my HttpContext.Request.Files property never contains the files that were...
2
by: FusionGuy | last post by:
I've created a file uploading handler, implemented as an httpHandler. Each time I attempt to upload a file, or files, my HttpContext.Request.Files property never contains the files that were...
1
by: fa_2064 | last post by:
hi every body when i run this code i receive this error! my "wwwroot" folder is shared, but i don't know what it's reason is!!! {"Access to the path...
1
by: WeCi2i | last post by:
Okay, I have a problem that has been stumping me for weeks. I have tried many different solutions and this is pretty much my last resort. I have seen a lot of good answers give here so I figured I...
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
2
by: Bremanand | last post by:
Hi folks, i am working in C# , i have problem while uploading the file to FTP which has size around 4MB. The code which comes after the bold area is not executed.. here am...
3
by: Bremanand | last post by:
Hi folks, i am working in C# , i have problem while uploading the file to FTP which has size around 4MB. The code which comes after the bold area is not executed.. here am interacting with DB for...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.