Solved

Convert.ToUInt32

Posted on 2006-06-20
4
296 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
  • 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 500 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now