Click here to Skip to main content
15,921,841 members
Home / Discussions / C#
   

C#

 
Questionsolution explorer Pin
Parshant Verma6-Oct-06 5:05
Parshant Verma6-Oct-06 5:05 
AnswerRe: solution explorer Pin
Amar Chaudhary6-Oct-06 8:21
Amar Chaudhary6-Oct-06 8:21 
AnswerRe: solution explorer Pin
asator6-Oct-06 9:17
asator6-Oct-06 9:17 
GeneralRe: solution explorer Pin
Amar Chaudhary6-Oct-06 9:28
Amar Chaudhary6-Oct-06 9:28 
QuestionUnit testing Database problem[VS2005] Pin
Snowjim6-Oct-06 4:44
Snowjim6-Oct-06 4:44 
Questionmdi forms Pin
shabonaa6-Oct-06 4:21
shabonaa6-Oct-06 4:21 
AnswerRe: mdi forms Pin
Ranjan Banerji6-Oct-06 5:45
Ranjan Banerji6-Oct-06 5:45 
GeneralRe: mdi forms Pin
shabonaa6-Oct-06 7:13
shabonaa6-Oct-06 7:13 
AnswerRe: mdi forms Pin
Amar Chaudhary6-Oct-06 8:16
Amar Chaudhary6-Oct-06 8:16 
QuestionTcpClient overhead Pin
Wjousts6-Oct-06 4:01
Wjousts6-Oct-06 4:01 
AnswerRe: TcpClient overhead Pin
WillemM6-Oct-06 4:39
WillemM6-Oct-06 4:39 
QuestionHandling multiple keys Pin
Bekjong6-Oct-06 3:58
Bekjong6-Oct-06 3:58 
Questionhow to change tempo of midi file Pin
Amar Chaudhary6-Oct-06 3:58
Amar Chaudhary6-Oct-06 3:58 
QuestionFormatException Pin
123456uio6-Oct-06 3:45
123456uio6-Oct-06 3:45 
AnswerRe: FormatException Pin
Martin#6-Oct-06 4:03
Martin#6-Oct-06 4:03 
GeneralRe: FormatException Pin
Guffa6-Oct-06 4:54
Guffa6-Oct-06 4:54 
GeneralRe: FormatException Pin
Martin#6-Oct-06 8:20
Martin#6-Oct-06 8:20 
GeneralRe: FormatException Pin
Guffa6-Oct-06 10:21
Guffa6-Oct-06 10:21 
Martin# wrote:
So I guess you would also recommend using double.TryParse plus cast to int, instead of try catch with Convert.ToInt32.


Yes. Exceptions are mainly for unexpected situations. If you expect something to happen, you should try to stop it before it happens.

Another alternative is to use a regular expression to validate the string before you convert it. If you have verified that a string only contains digits and not more than fits in the range of an int, you can safely convert it to an int.


---
b { font-weight: normal; }

Questionhi how can use c++ program in C#.net2003 application Pin
premkamalg6-Oct-06 3:23
premkamalg6-Oct-06 3:23 
AnswerRe: hi how can use c++ program in C#.net2003 application Pin
shabonaa6-Oct-06 4:15
shabonaa6-Oct-06 4:15 
Generalhi, i want use some c++ function in C#.net2003 Pin
premkamalg6-Oct-06 17:32
premkamalg6-Oct-06 17:32 
QuestionOpen a form? Pin
Wolf926-Oct-06 3:14
Wolf926-Oct-06 3:14 
AnswerRe: Open a form? Pin
Stefan Troschuetz6-Oct-06 3:26
Stefan Troschuetz6-Oct-06 3:26 
GeneralRe: Open a form? Pin
Wolf926-Oct-06 3:33
Wolf926-Oct-06 3:33 
GeneralRe: Open a form? Pin
Stefan Troschuetz6-Oct-06 3:41
Stefan Troschuetz6-Oct-06 3:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.