Click here to Skip to main content
15,890,336 members
Home / Discussions / C#
   

C#

 
GeneralRe: Tooltip on disabled controls? Pin
Nilesh K.27-Feb-07 20:22
Nilesh K.27-Feb-07 20:22 
GeneralRe: Tooltip on disabled controls? Pin
mike montagne28-Feb-07 5:41
mike montagne28-Feb-07 5:41 
GeneralRe: Tooltip on disabled controls? Pin
Nilesh K.28-Feb-07 16:01
Nilesh K.28-Feb-07 16:01 
GeneralRe: Tooltip on disabled controls? Pin
mike montagne28-Feb-07 17:53
mike montagne28-Feb-07 17:53 
QuestionCreating Help file (chm ) Pin
Praveen_S27-Feb-07 17:16
Praveen_S27-Feb-07 17:16 
AnswerRe: Creating Help file (chm ) Pin
Vasudevan Deepak Kumar27-Feb-07 17:29
Vasudevan Deepak Kumar27-Feb-07 17:29 
QuestionUserControl Pin
fjlv200527-Feb-07 16:44
fjlv200527-Feb-07 16:44 
QuestionConverting strings to other data types Pin
Leo Smith27-Feb-07 14:10
Leo Smith27-Feb-07 14:10 
I have a simple question. I would like to be able to test data conversions from string to other data types without throwing exceptions if it fails (throwing exceptions seems a bit sloppy). Here is a sample of what currently works, but I would like a cleaner version.

public bool IsInt(string sData)
{
bool bRtn = false;
try
{
int iTmp = Convert.ToInt32(sData);
bRtn = true;
}
catch (Exception) { }
return bRtn;
}

Any better ideas I'd love to hear them. This works but it will throw exceptions if the string cannot be converted to the correct data type (here int).

Thanks for your input.


Leo T. Smith

AnswerRe: Converting strings to other data types Pin
Christian Graus27-Feb-07 15:13
protectorChristian Graus27-Feb-07 15:13 
GeneralRe: Converting strings to other data types Pin
Leo Smith27-Feb-07 15:41
Leo Smith27-Feb-07 15:41 
QuestionWindows Status Bar / System Tray Pin
Rabbit1727-Feb-07 13:55
Rabbit1727-Feb-07 13:55 
QuestionWindows Service and Directory.Exists() Pin
Christopher Stratmann27-Feb-07 13:54
Christopher Stratmann27-Feb-07 13:54 
AnswerRe: Windows Service and Directory.Exists() Pin
Vasudevan Deepak Kumar27-Feb-07 17:32
Vasudevan Deepak Kumar27-Feb-07 17:32 
GeneralRe: Windows Service and Directory.Exists() Pin
Christopher Stratmann28-Feb-07 0:47
Christopher Stratmann28-Feb-07 0:47 
AnswerRe: enumerator woes Pin
mike montagne27-Feb-07 14:04
mike montagne27-Feb-07 14:04 
GeneralRe: enumerator woes Pin
Glen Harvy27-Feb-07 14:22
Glen Harvy27-Feb-07 14:22 
GeneralRe: enumerator woes Pin
mike montagne27-Feb-07 14:29
mike montagne27-Feb-07 14:29 
GeneralRe: enumerator woes Pin
Glen Harvy27-Feb-07 15:16
Glen Harvy27-Feb-07 15:16 
QuestionSimple Open File With... Question Pin
cmarcus27-Feb-07 13:14
cmarcus27-Feb-07 13:14 
AnswerRe: Simple Open File With... Question Pin
Vasudevan Deepak Kumar27-Feb-07 17:33
Vasudevan Deepak Kumar27-Feb-07 17:33 
AnswerRe: Simple Open File With... Question Pin
blackjack215027-Feb-07 23:13
blackjack215027-Feb-07 23:13 
QuestionC# Question with Generics Pin
malharone27-Feb-07 10:56
malharone27-Feb-07 10:56 
AnswerRe: C# Question with Generics Pin
Ssswamii27-Feb-07 12:58
Ssswamii27-Feb-07 12:58 
GeneralRe: C# Question with Generics Pin
malharone27-Feb-07 13:02
malharone27-Feb-07 13:02 
AnswerRe: C# Question with Generics Pin
Mattias Olgerfelt27-Feb-07 13:42
Mattias Olgerfelt27-Feb-07 13:42 

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.