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
873 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
Comment Utility
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
Comment Utility
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
Comment Utility
Glad to hear the good news. Cheers!
0
 
LVL 10

Author Closing Comment

by:kdwood
Comment Utility
Was able to solve on my own.
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

743 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

16 Experts available now in Live!

Get 1:1 Help Now