1

In Visual Studio 2010, attempting to use the Server Explorer to add a data connection.

From the Change Data Source screen I select Microsoft ODBC Data Source which moves me to the Add Connection screen. However, the dropdown for Use user or system data source name: only contains my user DSNs. My system DSNs are not shown.

I'm running on Windows 7, 64 bit and ran Visual Studio as administrator. The missing system DSNs use the SQL Server Native Client 10.0, but an equivalent user DSN using the same driver appears in the list.

TomDestry
  • 3,349
  • 5
  • 31
  • 40
  • Why use a system DSN when you have a MS SQL Server DB? Now you have to configure both, the DSN on the server and the connection string on your code. Instead of one thing to worry about, now you have two. – Icarus Dec 07 '11 at 21:04
  • In this situation I don't necessarily know the name of the database, but it will have a standard DSN name. – TomDestry Dec 07 '11 at 21:52
  • You still have to change the DSN. It doesn't buy you anything. – Icarus Dec 07 '11 at 22:06
  • The database is on a client's server. I can't tell them what to call their database, but I can ask them to create a DSN of a given name. – TomDestry Dec 07 '11 at 22:22
  • 1
    I am not trying to be a pain in the ass here, I apologize if I sound like I am being one. If you can tell them to create a specific DSN you can explain them that the db name in your connection string section of your web.config needs to match their database name and server's ip. It's even easier to change an XML file (web.config) than creating a DSN. – Icarus Dec 07 '11 at 22:37
  • OK, thanks, I'll bear that in mind. It would be nice to use a system DSN though if possible, as that is the standard connection we use for other systems. – TomDestry Dec 08 '11 at 04:13

1 Answers1

6

You say you are on a 64bit machine, Visual Studio used to be 32 bit only and thus would only see 32 bit DSN's. You could try running the 32 bit version of the ODBC manager and creating/checking your DSN exists in there. The path is usally something like C:\Windows\SysWOW64\odbcad32.exe

SPE109
  • 2,911
  • 1
  • 19
  • 16
  • You're absolutely right. I actually checked this before, but checked it again when you suggested it. **%WINDIR%\System32\odbcad32.exe** is the version my path defaults to, and that shows the user DSNs and my normal system DSNs. **%WINDIR%\SysWOW64\odbcad32.exe** also shows the same user DSNs (which is probably why I missed this last time) but it doesn't show my system DSNs. When I add one with this, it appears in the list in Server Explorer. Thanks. – TomDestry Dec 08 '11 at 13:32