Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 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 May 7th, 2007, 10:10 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default VC# 2005 Express Errors NOT being thrown

Ok, hopefully someone can help me out on this because it doesn't make any sense to me.

I am writing a Windows application that goes out and hits a Database server and if the database server can not be located, I need to handle the exception (obviously).

So I tested my code first with the correct connection string and everything worked as necessary then I adjusted the connection string to contain an invalid server name so that a SqlException would be thrown. For some weird reason the exception is not being thrown inside my application to where the Catch statement picks up and continues processing.

If I look in my Output window I can see that the runtime detected a First Chance Exception of SqlClient.SqlException but, again, my catch statement is never evaluated.

I also tried to explicitly throw an error as well as divide by Zero and, in both cases, the Output Window saw the errors but my catch statements were not evaluated nor was a message sent back to the user.

Any ideas??



================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
 
Old May 9th, 2007, 07:37 AM
Authorized User
 
Join Date: Feb 2007
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Have you tried running it on another computer? It could just be a bug in MSVS, not a bug in your code.

There are 10 types of people - Those who understand binary, and those who don't.
http://bschleusner.googlepages.com/home





Similar Threads
Thread Thread Starter Forum Replies Last Post
VWD Express 2005 and VS 2005 - Help not working dmlocke C# 2005 0 March 21st, 2007 04:19 PM
VC++ Build Errors, Help!!!!!!!!! gothicpurple Visual C++ 0 August 29th, 2006 06:35 PM
Please, need help with VC 2005 express IDE! pghTech Visual C++ 2005 0 June 27th, 2006 06:40 PM
build errors in vc++ angel188 Visual C++ 0 June 6th, 2006 06:41 AM





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