If you are going to allow invalid data (which you shouldn't) then you should be using int.TryParse instead of int.Parse. Currently you only check for an empty string and this is why you are crashing (one reason anyway).
| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | VB Forums | Developer.com |
|
Results 1 to 14 of 14
Thread: Newbie here - a few questions..Threaded View
|
Click Here to Expand Forum to Full Width |