Answered by:
Can't set up new ADO.NET connection to SQL

Question
-
Please forgive me if this is not the right forum, but I think this is a good starting point. I have Visual Studio 2010 installed on multiple PCs that I use for application development. On my primary development machine, I've suddenly lost the ability to create new connections.
When I try to create a new SqlDataSource, the first sign of trouble is that even though I'm providing valid credentials (and I know they're valid because I can successfully create the new datasource on my other PC's), when I attempt to pull down the drop-down list of available databases, there are no databases listed. So I type in the database name, and then I get a dialog box that says, "Unable to find the requested .Net Framework Provider. It may not be installed."
After reading some more stuff in the forums, I tried "repairing" both my VS2010 installation and "repairing" the .NET 4.0 framework on the problem PC. After doing both of these things, I am continuing to get the same results.
So, now I need the help of people smarter than me (ie, most of you!) to help me figure out what to try next.
Thanks!
Tuesday, February 1, 2011 1:47 PM
Answers
-
Hi,
Welcome to ADO.NET Managed Providers forum!
First, let us clarify the issue. Do you mean you recieve the error message in this "Add Connection" dialog?
If so, can you change data source and see the following dialog listing the providers when pressing the "Change..." button?
Based on my research using Process Monitor, VS2010 will access several Registry keys and some provider dlls when these dialogs are shown. Please double check whether this Registry key is correct in your machine:
HKCU\Software\Microsoft\VisualStudio\10.0_Config\DataProviders\{91510608-8809-4020-8897-fba057e22d54}\, it's for the provider key for .NET Framework Data Provider for SQL Server.Also, please check the whether this provider is loaded correctly by VS2010,
64bit system: \Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Microsoft.VisualStudio.Data.Providers.SqlServer.dll.
32bit system: \Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Microsoft.VisualStudio.Data.Providers.SqlServer.dll
Similiar issue can also happen when machine.config file is not correct. Please compare the machine.config file in your system with the ones in other systems to see whether there are any difference, especially the <system.data> <DbProviderFactories> element. The file should be under the folder \Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config.
Please feel freel to let me know if you have any questions.
Good day!
Thanks
Michael Sun [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Proposed as answer by Michael Sun [MSFT]Microsoft employee Thursday, February 10, 2011 6:46 AM
- Marked as answer by Michael Sun [MSFT]Microsoft employee Saturday, February 12, 2011 1:02 AM
Wednesday, February 2, 2011 4:06 AM -
Yes, I would recommend you use Process Monitor to check the Registry changes. Actually I used this tool to troubleshoot the problem in my first post. We need to use it to monitor Registry changes during the process IBM provider installation.
Some references:
http://www.winvistaclub.com/t54.html|Related APIs to check Registry changes
http://social.msdn.microsoft.com/Forums/en/vbgeneral/thread/b7d9a901-0643-4903-9bad-789ae1d6ff35If you get any updated information from the support engineers of the 3rd party provider, could you please share the result here to benefit more community members? Thanks a lot!
Have a nice weekend!
Thanks
Michael Sun [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Marked as answer by ASI Scott Friday, February 11, 2011 4:49 PM
Friday, February 11, 2011 1:31 AM -
Well, this seems to be a non-issue at this point.
Although I completely reinstalled Windows, I was getting the same error multiple times. However, I started a fourth time with a fresh install of Windows. Each step of the way I backed up an image of my HDD so I could revert one step backward if I ever needed to.
I installed Windows 64-bit and all of its updates first.
Then I installed Visual Studio 2008 and all of its updates.
Then I installed the IBM .NET Provider for DB2 (a third-party product produced by IBM)
Then I installed Visual Studio 2010 and all of its updates.
Then I installed the latest Service Pack for the IBM .NET Provider for DB2 (which extends all the Visual Studio data controls to the iSeries).
It appears not to fail at this point, and I can successfully connect my VS Development Objects to both MS SQL and IBM iSeries DB2 data.
My only guess is that it has something to do with the order in which stuff is installed. I've lost a week trying to get to this point, so unfortunately I can't spend a whole lot more time figuring out why it broke previously but is working now. I've got to get back to work.
Thanks for your help, Michael! I do appreciate the professional and prompt responses I got on the forum!
- Marked as answer by Michael Sun [MSFT]Microsoft employee Saturday, February 12, 2011 1:04 AM
Friday, February 11, 2011 4:48 PM
All replies
-
Hi,
Welcome to ADO.NET Managed Providers forum!
First, let us clarify the issue. Do you mean you recieve the error message in this "Add Connection" dialog?
If so, can you change data source and see the following dialog listing the providers when pressing the "Change..." button?
Based on my research using Process Monitor, VS2010 will access several Registry keys and some provider dlls when these dialogs are shown. Please double check whether this Registry key is correct in your machine:
HKCU\Software\Microsoft\VisualStudio\10.0_Config\DataProviders\{91510608-8809-4020-8897-fba057e22d54}\, it's for the provider key for .NET Framework Data Provider for SQL Server.Also, please check the whether this provider is loaded correctly by VS2010,
64bit system: \Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Microsoft.VisualStudio.Data.Providers.SqlServer.dll.
32bit system: \Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Microsoft.VisualStudio.Data.Providers.SqlServer.dll
Similiar issue can also happen when machine.config file is not correct. Please compare the machine.config file in your system with the ones in other systems to see whether there are any difference, especially the <system.data> <DbProviderFactories> element. The file should be under the folder \Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config.
Please feel freel to let me know if you have any questions.
Good day!
Thanks
Michael Sun [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Proposed as answer by Michael Sun [MSFT]Microsoft employee Thursday, February 10, 2011 6:46 AM
- Marked as answer by Michael Sun [MSFT]Microsoft employee Saturday, February 12, 2011 1:02 AM
Wednesday, February 2, 2011 4:06 AM -
Thanks for your assistance. Yes, the dialog boxes that you copied and pasted are the ones where I am having the issue. I am able to select the various providers that are listed in the second dialog box.
Unfortunately, I cannot check any of this right now. I am snowed in at home, and the offending PC is on my desk at the office. Tried to remote in, but I cannot. I don't know if we had a power outage or if my PC failed to reboot after an update or what, but I am unable to remote to it. So, hopefully I can make it to work tomorrow and try your suggestions. I'll post my success (or lack thereof) when I'm able to try it. Thanks again!
Wednesday, February 2, 2011 1:36 PM -
You're welcome! I am looking forward to your test result. :)
Good day!
Thanks
Michael Sun [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Thursday, February 3, 2011 1:18 AM -
Hi Scott,
Do you have time to try the suggestions?
If you need any further assistance, please feel free to let me know.
Good day!
Thanks
Michael Sun [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Wednesday, February 9, 2011 1:08 AM -
Still not sure what the problem is. I think it has something to do with a third-party provider, specifically the IBM DB2 Provider for .NET. When I install that, all my database connection abilities in VS 2010 break. I'm working with them to resolve the issue at this time. I think it screws up some essential registry entries.
Is there any such tool that will let me look at the registry changes that are made between two timepoints? I'd like to know what registry entries are changed by the installation of the IBM provider.
Thursday, February 10, 2011 3:59 PM -
Yes, I would recommend you use Process Monitor to check the Registry changes. Actually I used this tool to troubleshoot the problem in my first post. We need to use it to monitor Registry changes during the process IBM provider installation.
Some references:
http://www.winvistaclub.com/t54.html|Related APIs to check Registry changes
http://social.msdn.microsoft.com/Forums/en/vbgeneral/thread/b7d9a901-0643-4903-9bad-789ae1d6ff35If you get any updated information from the support engineers of the 3rd party provider, could you please share the result here to benefit more community members? Thanks a lot!
Have a nice weekend!
Thanks
Michael Sun [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Marked as answer by ASI Scott Friday, February 11, 2011 4:49 PM
Friday, February 11, 2011 1:31 AM -
Well, this seems to be a non-issue at this point.
Although I completely reinstalled Windows, I was getting the same error multiple times. However, I started a fourth time with a fresh install of Windows. Each step of the way I backed up an image of my HDD so I could revert one step backward if I ever needed to.
I installed Windows 64-bit and all of its updates first.
Then I installed Visual Studio 2008 and all of its updates.
Then I installed the IBM .NET Provider for DB2 (a third-party product produced by IBM)
Then I installed Visual Studio 2010 and all of its updates.
Then I installed the latest Service Pack for the IBM .NET Provider for DB2 (which extends all the Visual Studio data controls to the iSeries).
It appears not to fail at this point, and I can successfully connect my VS Development Objects to both MS SQL and IBM iSeries DB2 data.
My only guess is that it has something to do with the order in which stuff is installed. I've lost a week trying to get to this point, so unfortunately I can't spend a whole lot more time figuring out why it broke previously but is working now. I've got to get back to work.
Thanks for your help, Michael! I do appreciate the professional and prompt responses I got on the forum!
- Marked as answer by Michael Sun [MSFT]Microsoft employee Saturday, February 12, 2011 1:04 AM
Friday, February 11, 2011 4:48 PM -
It's our pleasure! MSDN forum is a great forum! :)
I am very glad to hear the problem is solved. I will mark your post as answer as well since I think the order these stuffs are installed can be the cause of the issue.
Have a nice weekend!
Michael Sun [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Saturday, February 12, 2011 1:03 AM