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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

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…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how the fundamental information of how to create a table.

695 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