Win Surprise Gifts!!!
Top 5 Contributors of the Month
Post New Question
Subscribe to Forum
Exception Handling in Own Massage
November 01, 2009
do you have any idea how can handle the DataGridView
exception in Own Message like when i put the string values in cells then they are given me big exception which is not good to understand for client. so please tell me how to change this exception in own message and if any idea about validation in cells then let me know cells only accept int or decimal values not take string values
Thank in Advance
Lakhan Pal Garg
Posted Date: November 01, 2009 Points: 5
Hi Naim -
Bind your GridView Items in DataBound Event and Add try catch (For Specific Exception type) there to Catch the error and show user friendly message to user.
Thanks & Regards
Lakhan Pal Garg
Posted Date: November 04, 2009 Points: 5
The thrown exception can be caught or dealt within the calling method using the try...catch block.
The code that may throw an exception which we want to handle is put in the try block. This is called an attempt to catch an exception.
The code to handle the thrown exception is placed in the catch block just after the try block. This is called catching the exception. We can define which particular class of exception we want to deal in this catch block by mentioning the name of exception after the catch keyword
Multiple catch blocks can be defined for a single try block where each catch block will catch a particular class of exception.
The code that must always be executed after the try or try...catch block is placed in the finally block, placed just after the try or try...catch blocks. This code is guaranteed to always be executed whether the exception occurs or not.
When an exception is raised during the execution of the code inside the try block, the remaining code in the try block is neglected and the control of execution is transferred to the respective catch or finally block.
Posted Date: October 16, 2010 Points: 5
To post reply
Related Questions Related Questions
Best practices of Exception handling in ASP.NET web applications
Exception Handling in sql server
exception handling in c#.net?
Sql Server Exception Handling
How to use throw () method in exception handling. Give me an example
Exception handling using NLog tool
query handling in asp
ASP.NET - Error Handling in Database Stored Procedures
Latest Forum Questions From The Same Category
database is read-only.
editor for visual basic with c#.net
How to get phone number in .Net windows application?
while accessing method from proxy giving an unauthorized access
How to make search between two dates accept null not obligatory search proplem
Create a Windows form application using Excel as database..
Recieve Data From Serial Com Port C# In One Line And Convert To integer
display parent data and child data as a row group in one datagridview using c# winform
enter key event in windows app c#.net
windows appplication c#.net
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more
Quick Links For Forum Categories:
Hall of Fame
Terms of Service
Tell A Friend