Subscribe to Subscribers
Talk to Webmaster Tony John

Resources » .NET programming » .NET Framework

Windows Exception in Dot Net


Posted Date:     Category: .NET Framework    
Author: Member Level: Bronze    Points: 2



 


As we have declared as Int16 in the program the input must be entered as a number in the Input Textbox. But instead if we enter a Decimal Number. Actually this is a format exception Error. But instead of giving separate exception for format and Overflow errors. We can give system Exception as a common error. This windows exception handles all the Known and Unknown Errors that is specified.

CODING:
Private Sub CoversionButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CoversionButton.Click
Try
Decimal1 = System.Double.Parse(InputTextBox.Text)
Decimal2 = 10.11 Decimal2 += 10.645 ResultListBox.Items.Add(Decimal2.ToString("0.00"))
Dim Stri = Decimal2.ToString("0.00")
ResultListBox.Items.Add("ToString():" & Stri)
Decimal1 = System.Convert.ToSingle("decimal2")
Catch ex As SystemException MessageBox.Show(ex.ToString, "Unknown Error ", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try

End Sub





Did you like this resource? Share it with your friends and show your love!


Responses to "Windows Exception in Dot Net"

No responses found. Be the first to respond...

Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Next Resource: OverFlow Exception in Dot Net
    Previous Resource: Debug Logical Errors in Dot Net
    Return to Resources
    Post New Resource
    Category: .NET Framework


    Post resources and earn money!
     
    More Resources
    Popular Tags   Tag posting guidelines   Search Tags  
    Windows Exception in Dot Net  .  
    Active Members
    TodayLast 7 Daysmore...

    Awards & Gifts
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
    2005 - 2012 All Rights Reserved.
    .NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
    Articles, tutorials and all other content offered here is for educational purpose only.
    We are not associated with Microsoft or its partners.