Click here to Skip to main content
15,886,069 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi


Convert.ToInt64(NumTestCaseText.Text) i am getting the issue string not correct form at with this.

can any one help on this..
Posted
Comments
Johnny J. 16-Jul-13 6:12am    
What is NumTestCaseText.Text when you get the error?

If the input string format is wrong (that is it not represent a valid Int64) then all you can do is handle the FormatException gracefully, for instance asking the user to enter again the text.
 
Share this answer
 
Maybe you should check for null and empty:

C#
Convert.ToInt64(!string.IsNullOrEmpty(NumTestCaseText.Text) ? NumTestCaseText.Text : "0");


Just a guess, really - without knowing any more, it could be anything...
 
Share this answer
 
try this...:)

C#
int result=0;
int.TryParse(NumTestCaseText.Text,out result)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900