ASP.NET 1.1As 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
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.
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