?
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
Medium Priority
?
882 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 11

Assisted Solution

by:jasonduan
jasonduan earned 1000 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Suggested Courses

765 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