If you try to assign an int to a string...then yes you will get a compile
time error. I'm guessing that you're trying to catch the exception raised
when people enter invalid data through a dialog interface. I think what
you're trying to catch would be of type System.FormatException so you could
do something like this...
try
{
....
}
catch (System.FormatException exception)
{
MessageBox(exception.Message);
....additional handing...
}
hope this helps...
Chris
--
Securing your systems is much like fighting off disease -- as long as you
maintain basic hygiene, you're likely to be okay, but you'll never be
invulnerable.
Steve Shah - Unix Systems Network Administrator
"Ant" <An*@discussions.microsoft.com> wrote in message
news:EA**********************************@microsof t.com...
Hi,
I'd like to catch a specific exception that is raised when an int is
assigned a string. I can't force the exception to see what is thrown
because
it creates a compile time error when fed a dummy value.
What exception would I choose to do this. (to catch a wrong assignment
exception, specifically string value to int type)?
Thanks for your thoughts in advance
Ant