Re: ConnectionString using DSN not working

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



DSNs are not supported for SqlClient, mainly because they're a huge
security vulnerability. When connecting to a SQL Server database from
your .NET code you should always use SqlClient, not odbc or oledb.
SqlClient gives you functionality that the other data providers don't.
The only exception to that rule would be if you were connecting to
SQLS v6.5 or earlier, which doesn't seem to be the case here.

--Mary

On 17 Apr 2007 04:32:57 -0700, Fendi Baba <effendi@xxxxxxxxxxxxxx>
wrote:

I have been using SqlConnection .NET strings in my web,config and my
application is working finr. However due to requirements, I am forced
to change the connection string to use DSN and I cannot connect to the
data. Can anyone point out what is wrong with my settings.

Here is the SqlConnection in my web.config

<add name="LocalSqlServer" connectionString="server=EFFENDI
\SQLEXPRESS;uid=CoopAdmin;pwd=pass;database=coopgown"
providerName="System.Data.SqlClient" />


And here is the one using DSN

<add name="LocalSqlServer"
connectionString="Dsn=DBADGRAD;uid=CoopAdmin;pwd=pass"
providerName="System.Data.Odbc" />

When I try to open the Asp.net application Configuration pages, I get
the following error mesages

An error occurred while attempting to initialize a
System.Data.SqlClient.SqlConnection object. The value that was
provided for the connection string may be wrong, or it may contain an
invalid syntax. Parameter name: connectionString

Any ideas?

Thanks in advance.
.



Relevant Pages

  • Re: DSN VS Logon
    ... What protocol are you connecting with? ... We're moving on servers to a new Domain then we will reimage ... Before we moved it the DSN file worked fine we ... You can check your MDAC ...
    (microsoft.public.sqlserver.security)
  • Diconnection Problem
    ... I am creating an adp in Access 2003 at home and connecting over the ... internet via a VPN to a SQL Server database at work. ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Sybase SQL Anywhere
    ... I would first create a DSN (ODBC datasource). ... A great method of connecting to external data is ...
    (microsoft.public.access.gettingstarted)
  • Re: ODBC connection without knowing user and password
    ... ODBC System DSN did not store password. ... As a rule, the a DBMS checks for credentials, not a DSN or the Driver ... You have not specified the DBMS you are connecting to. ...
    (microsoft.public.data.odbc)
  • Newbie with question about data access
    ... I'm an Access Developer just learning about VB .NET 2003. ... to be connecting to a SQL Server database. ...
    (microsoft.public.vsnet.general)