Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > Pro VB.NET 2002/2003
|
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 10th, 2005, 04:15 PM
Registered User
 
Join Date: May 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Number Stored as Text problem

I am generating a report with vb .net in a .xls sheet but my numbers are stored as text. how can I fix this?

The number of hours is saved as text and not as number. Any ideas?
[vb]
...
While i < dsetTask.Tables("tblTask").Rows.Count
            drowData = Data.NewRow()
            drowData("Name") = dsetTask.Tables("tblTask").Rows(i)("Name")
            drowData("Hour") = dsetTask.Tables("tblTask").Rows(i)("Hour")
End While
...
[/vb]
I tried to CType the right-hand-side of the drowData("Hour")=... to type Single or Double, still gives me cells with numbers in them but it says that the numbers are stored as text. WHAT DO I DO? :(

 
Old May 12th, 2005, 12:18 PM
Registered User
 
Join Date: May 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am doing it in visual studio .net with an aspx page that queries the database and feeds the html to the browser with a mime type so it will be rendered in excel. The problem is that numbers will be stored as text! MSDN has the exact same thing in one their examples: http://support.microsoft.com/defaul...kb;en-us;317719

I have tried this with Northwind database like the example and it works fine! when I do it with my database the numbers remain as text.

What do you think is the problem and how do I solve it?


 
Old May 13th, 2005, 08:48 AM
Registered User
 
Join Date: May 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sorry about the broken link, here it is:

http://support.microsoft.com/default...b;en-us;317719






Similar Threads
Thread Thread Starter Forum Replies Last Post
number problem kyledonmoyer BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 2 July 31st, 2008 05:57 PM
running scrolling text from stored procedure in VS cJeffreywang ASP.NET 2.0 Basics 1 August 14th, 2007 03:47 PM
Excel format changes from Number to Text ajindal General .NET 2 July 24th, 2007 06:56 AM
specifying number of text fields Astro VB How-To 64 August 9th, 2005 08:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.