Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 208585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:50:20+00:00 2026-05-11T17:50:20+00:00

IDE = VS7 or 2002 Hi all, I have a really weird problem here.

  • 0

IDE = VS7 or 2002

Hi all, I have a really weird problem here. The code doesn’t appear to be executing as expected. I’m running this through the debugger and it’s performing really strangely.

I have made sure that the Virtual Directory is using ASP.NET 1.0.3705.

The code follows and I explain what the debugger shows me as the execution steps in the comments:

try
{
    objConnection.Open();  // STARTS HERE
    objCommand.ExecuteNonQuery();  // DOES NOT THROW EXCEPTION
    int c = 0;  // THIS LINE IS EXECUTED
}
catch (SqlException sqle)
{

    LogError();  // THIS LINE IS NOT EXECUTED
    throw sqle;  // THIS LINE IS EXECUTED AFTER THE int c = 0; 
                 // sqle IS NULL
                 // EXCEPTION IS NOT CAUGHT AND 
                 // EXECUTION CONTINUES IN FINALLY BLOCK
}
finally
{
    // EXECUTES AS EXPECTED FROM HERE ON OUT,
    // AS THOUGH THE throw sqle; DID NOT HAPPEN.
    if (objConnection.State == ConnectionState.Open) objConnection.Close();
}

Has anyone experienced this strange behaviour before? Any idea how to fix it? I may change the method extensively, but I’d still like to know why this is happening.

I suspect since the sqle is null that is why the throw does not behave as expected. But why did we jump into this code block in the first place?

I have reloaded it several times, saved and rebuilt, and executed with the debugger and watched this behaviour multiple times.

Thank you all for your help!

All the best,

Graham

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T17:50:20+00:00Added an answer on May 11, 2026 at 5:50 pm

    Wait.. your code doesn’t throw an exception and you’re wondering why it doesn’t execute the catch block?

    EDIT (referencing your comment):

    That sounds really hard to believe. I never heard of a case where the actual exception inside the catch block was null and as you already mentioned did the first line inside the catch block not execute which in my opinion points into the direction that there was no exception at all.

    Did you try to check the program flow by using old-fashioned debugging techniques (Debug.WriteLine) and skipping the debugger?

    My assumption is that you’re looking at the wrong place where the exception is thrown.. or there’s no exception at all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

IDE: Microsoft Visual Studio Professional 2008 Language: C# Background: I have one form and
My dream IDE does full code hints, explains and completes PHP, Javascript, HTML and
Can the Visual Studio IDE profile be changed without clearing all VS settings?
Are there any IDE's for developing HLSL code? The three key features I want
IDE : VS 2008, Platform : .NET 3.5, Hi, Here is my DataTable columns
IDE,SCSI,SSD,SATA or all of those.
IDE - Visual Studio 2008, Visual C++ I have a custom class Class1 with
I was wondering which IDE choice you flash developer use to write the code....I
We have an IDE for machine automation that allows its users to develop solutions
What's a good IDE for CSS that makes validation of the code as you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.