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
880 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 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
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…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

733 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