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

x
?
Solved

How to convert a string to a unsigned long number in C#?

Posted on 2011-03-24
6
Medium Priority
?
474 Views
Last Modified: 2013-12-17
Want to convert a string to a big number. For example, want to achieve
ToULong("1234567890");
 I got the error:
"error CS0103: The name 'ToULong' does not exist in the current context"
0
Comment
Question by:jl66
[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
6 Comments
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 680 total points
ID: 35204925
           ulong ul = Convert.ToUInt64("1234567890");
0
 
LVL 19

Assisted Solution

by:Rikin Shah
Rikin Shah earned 120 total points
ID: 35204965
Alternative to ToULong is ToUInt64. Try it.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 35204973
Isn't that what I said?
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 52

Assisted Solution

by:Carl Tawn
Carl Tawn earned 600 total points
ID: 35205011
Alternative, albeit it only semantic since they both do the same thing:
ulong ul = ulong.Parse("1234567890");

Open in new window

0
 
LVL 8

Assisted Solution

by:cubaman_24
cubaman_24 earned 600 total points
ID: 35214157
And with tryparse..

Best regards.
ulong number;
if(ulong.TryParse("33535355353", out number){
// Do stuf
}

Open in new window

0
 

Author Closing Comment

by:jl66
ID: 35220815
Really appreciated everyone's tips.
0

Featured Post

Command Line Tips and Tricks

The command line is a powerful tool at the disposal of every Linux user. Although Linux distros come with beautiful user interfaces, it's worthwhile to learn the command line because it allows you to do a number of things that you otherwise cannot do from the GUI.  

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
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: …

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