[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

The best overloaded method match for 'int.TryParse(string, out int)' has some invalid arguments

Posted on 2009-02-08
2
Medium Priority
?
1,629 Views
Last Modified: 2013-12-17
I am trying to convert an interger to a string but keep getting this error message.  Can someone point out what I am missing.
string myStr;
                        string mySSN;
                        mySSN = patient.u.ssn;
                       
                        if (Int32.TryParse(mySSN, out myStr))
                        {
                            
                            patient.u.ssn = myStr;
                        }
                        else
                        {
                            // Failed! MyStr is not defined.
                        }

Open in new window

0
Comment
Question by:kwh3856
2 Comments
 
LVL 41

Accepted Solution

by:
guru_sami earned 2000 total points
ID: 23587173
First thing:
The method is : Int32.TryParse Method (String, Int32)
but your parameter are mySSN  and myStr are both String.

Secondly when you say "I am trying to convert an interger to a string" not sure what you are trying to do...but you can convert an integer to String using ToString() method:

e.g. String mySSN = patient.u.ssn.ToString();
0
 

Author Closing Comment

by:kwh3856
ID: 31544376
guru sami,
Thank you for your response.  What I realized is that I really needed to change the type of the field in the database to varchar which makes it a string also.  Therefore I do not need to covert the SSN anymore.  Again, thank you for your response.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

865 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