Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Convert.ToUInt32

Posted on 2006-06-20
4
Medium Priority
?
312 Views
Last Modified: 2010-04-23
All,

I am trying to use this method that requires the data being sent in to be converted to UInt32.  However, every time I use Convert.ToUIn32() I get an error saying the string is not in the correct format.  Can anyone provide any type of guidance on this command.  I have only used it once for a very minor project.  Thanks.

Jason
0
Comment
Question by:ammotroop
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 16

Expert Comment

by:Swapnil Piparia
ID: 16940936
Hi ammotroop,

Have you debug it, means have u checked what value string contains which you are going to convert to UInt32. If it contains any alpha characters or it contains the value which is out of range of UInt32?

Regards,
NetSwap
0
 
LVL 1

Author Comment

by:ammotroop
ID: 16940991
Well, lets say that I am trying to convert "3".  It gives me an error.  If I just use 3 it gives me an error.  For some reason each time I use it just keeps giving me the same error.

????

I am sure it is something easy but my brain is so fried right now that I can not even think.

Jason
0
 
LVL 17

Accepted Solution

by:
ZeonFlash earned 2000 total points
ID: 16941555
I just did a test using the following, and everything came out fine.  What version of VS are you running?  And can you post the code that you're using that is trying to convert?

        Dim uintTest As UInt32
        uintTest = Convert.ToUInt32(3)
        uintTest = Convert.ToUInt32(CInt("3"))
0
 
LVL 1

Author Comment

by:ammotroop
ID: 16977927
I running VB.Net 2005 Express Edition.

I have found out that UInt32 is not the correct parameter even though that is what it says on MSDN.  The correct info should have been in string format.  Got it working.  But thanks for the help.

Jason
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question