Last post Jul 19, 2013 01:09 AM by kctt
Jul 15, 2013 12:56 PM|redhawkdev|LINK
I have installed visual studio express 2012 for web and am trying to set up a data connection for a ODBC driver to access data via an existing DSN (notessql). Everything I have found so far says to select the Odbc data provider from the list in a new Data
Connection. It is not there. And under "other" it only lists oledb, SQL server compact 4.0, and SQL server.
I have checked the machine.config files and the odbc is listed under DbProviderFactories. I went so far as to uninstall visual studio, uninstall .NET 4.5, any references to prior versions, and then reinstall visual studio express 2012 for web.
The list below is in the machine.config file in C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG
The section in the v4 version was empty so I tried copying the values into the machine.config into C:\Windows\Microsoft.NET\Framework\v4.0.30319 with no luck.
<add name="Odbc Data Provider" invariant="System.Data.Odbc" description=".Net Framework Data Provider for Odbc" type="System.Data.Odbc.OdbcFactory, System.Data, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<add name="OleDb Data Provider" invariant="System.Data.OleDb" description=".Net Framework Data Provider for OleDb" type="System.Data.OleDb.OleDbFactory, System.Data, Version=188.8.131.52, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<add name="OracleClient Data Provider" invariant="System.Data.OracleClient" description=".Net Framework Data Provider for Oracle" type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=184.108.40.206, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<add name="SqlClient Data Provider" invariant="System.Data.SqlClient" description=".Net Framework Data Provider for SqlServer" type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<add name="Microsoft SQL Server Compact Data Provider" invariant="System.Data.SqlServerCe.3.5" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=18.104.22.168, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=22.214.171.124, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
The DSN for my odbc driver works in Excel just fine. It also works in SQL Server Managment Studio set up as a Linked Server.
How do I get either of the following to be available in Visual Studio?
1. Under Data Provider in Change Data Source have the ".NET Framework Data Provider for Odbc" appear in "other"
2. Select "other" and selected ".NET Framework Data Provider for OLDEB" and then under OLE DB Provider show "Microsoft OLE DB Provider for Odbc". It is not listed.
(This was previously posted in Visual Studio Installation but it was removed and I was advised to post here)
Jul 15, 2013 01:42 PM|PatriceSc|LINK
Could it be just related to the VS Express UI that would perhaps not show each and every provider but just main ones ? What if you try some code that does try to use the provider. Does it work ?
Also things to watch out are :
- a DSN could be less convenient (especially if this is a user DSN as an ASP.NET runs under a particular account that won't have this SDN. I would use a DSN less connection)
- double check if your code runs in 32 or 64 bit mode (you can't use 32 bit DLLs from 64 bit mode so a 32 bit odbc driver won't be seen if you run in 64 bit mode)
Jul 15, 2013 02:15 PM|redhawkdev|LINK
I understand the DSN is less than optimal but it is what I have to work with. It is 32bit.
It works fine if I call it directly. I have a connectionstring in the webconfig and I can connect via the driver by using OdbcConnection.
public OdbcConnection con = new OdbcConnection("DSN=CIS");
I would like to be able to set this up as a Data Connetion rather than write my own interface.
Jul 17, 2013 05:44 AM|PatriceSc|LINK
Gave this a try with VS 2013 Ultimate/Express and this is the same behavior and I'm alsmot sure you had also other differences preivously (not SQL Server just Express with user instances in older VS releases). IMO this is just an intentional differences
between UI (perhaps to not embark the code that would be needed to dealt with server explorer and other datasource kinds ?)
Not sure how this is related with writing your own UI. This is a VS UI and is not usable from within your own app (you want to provide some kind of didalog so that users can configure the source ?) If yes, you could perhaps use an UDL file to tigger the
Windows built-in UI (even if you then just copy the content of the resulting file rather than really using it).
Jul 17, 2013 06:02 PM|redhawkdev|LINK
Thank you for trying this in VS 2013 Ultimate/Express. This is the first clue that it is not my installation and ODBC does not seem to be available. Could anyone else check to see if the ODBC data providers are present in 2012 Express for web or 2013 Ultimate/Express?
Perhaps I was not clear in my previous post. I am not trying to rewrite the VS UI. I am simply trying to determine why my installation of VS express 2012 for web does not show any reference to ODBC in the Data Connections.
Jul 19, 2013 01:09 AM|kctt|LINK
There is some problem with your visual studio install.
ODBC data source should be available in data connections