Solved

Urgent Help Needed on SQL Error -  A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll

Posted on 2011-02-11
4
875 Views
Last Modified: 2012-05-11
Greetings gurus,

I've got a strange problem that I would sure appreciate some help with.    When I try to run past working projects or create new projects that use an SQL server as a data source, I get the following error and no data is returned:    "A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll"

I am using Visual Studio 2008 and I have SQL 2008 Express Advanced edition (64 Bit), loaded on my development PC and have a mix of SQL 2005 and 2008 servers.   My PC is running Vista 64.

I have tried the following in my troubleshooting efforts:

1.  I've created a brand new simple project with a with a new connection string pointing at new table and still get the error.
2.  I've created a local table in my SQL Express database and still get the error.   Therefore, I get the error no matter what SQL Server I point to.
3.  I unistalled my local SQL Server 2008 Express, cleaned all of the registry entries that I could find and reinstalled SQL Express 2008 Advanced.
4.  I then retried all of the steps above with the same error.

Here is the odd thing,  when I am within a project I can click on a tableadapter and preview the data from the "Preview Data" option and it brings back the data just fine.   However, if I launch the project, I immediatly get the error and not data is returned.   My sample project has a single datagridview that is bound to a simple test table.  The default fill method is being called on the form load event.

I'm stumped on this one.   HELP PLEASE!!!!!

Regards,

Keith
0
Comment
Question by:kdwood
  • 2
  • 2
4 Comments
 
LVL 11

Assisted Solution

by:jasonduan
jasonduan earned 250 total points
ID: 34873271
Check the InnerException property of the Exception object. Is it null or something else?
0
 
LVL 10

Accepted Solution

by:
kdwood earned 0 total points
ID: 34873644
jasonduan,

There was no InnerException propert that I could see, as the error was showing in the Immediate Output window.  

I was able to fix the problem by clicking on Debug/Exceptions and I clicked the reset all button.  I'm guessing that reset the debugger exception handling back to the defaults.  I have no idea what I may have had selected by mistake.  In fact, I don't ever remember going into that option.

Thank you for your response.

Regards,

Keith
0
 
LVL 11

Expert Comment

by:jasonduan
ID: 34873656
Glad to hear the good news. Cheers!
0
 
LVL 10

Author Closing Comment

by:kdwood
ID: 34904827
Was able to solve on my own.
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now