Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Convert.ToUInt32

Posted on 2006-06-20
4
Medium Priority
?
317 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 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

824 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