Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 4th, 2005, 06:18 AM
Authorized User
 
Join Date: Jun 2005
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Jayahar Send a message via Yahoo to Jayahar
Default Exception Handling

Hi all...

     Can any one say, How to capture the exception in the ASP.NET, which actually has occured in the SQL Server.

regards,

jayahar
__________________
Regards,
Jayahar Aruchamy.
Life is all about expecting the unexpected.
 
Old August 4th, 2005, 07:17 AM
Authorized User
 
Join Date: Nov 2003
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Jayahar,

           Are you familiar with MVC pattern. Because this pattern can help you to solve the problem with capturing exception.

            I will give you the easiest solution for a little web application. Make a group of class (buisness object) who will call the sql server where you will able to capture all exception and in your code behinde you will call theirs objects for saving, deleting and ect... With this your asp.net code will be separated of your buisness code and your data access.

        I hope that will help you. There is lot of pattern better of my little example but it better that capturing sql exception in your asp.net page. If i'm not enought clear just tell me, i will try to explain more clearly. My english is little bit bad sometime.

François

 
Old August 5th, 2005, 02:39 AM
Authorized User
 
Join Date: Dec 2004
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try
  'Open sql connection
  'Command bla bla
  'datareader bla bla
  'Insert/update/delte
  'close cmd
  'close connection
catch E as exception
 response write(E.message)
 'or
 'Label1.text="sorry there is an error"
end try

Hope this helps


bdl





Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception Handling NewTitle2007 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 6 August 8th, 2007 04:03 AM
exception handling jay schumacher VB.NET 2002/2003 Basics 1 April 14th, 2006 08:40 AM
Exception handling in ASP Deepmala Classic ASP Professional 1 February 18th, 2006 10:47 AM
Exception handling aldwinenriquez General .NET 0 August 17th, 2005 06:13 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.