Re: ConnectionString using DSN not working

Tech-Archive recommends: Speed Up your PC by fixing your registry



Ok, But when I created tableAdapters to use connectionstring created
using DSN, it work normally. While not doubting whatyou've said, I am
jsut trying to figure out what to tell my bosses why I cant use DSN...


On Apr 18, 12:15 am, "Mary Chipman [MSFT]" <m...@xxxxxxxxxxxxxxxxxxxx>
wrote:
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 <effe...@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 useDSNand 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 usingDSN

<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.- Hide quoted text -

- Show quoted text -


.



Relevant Pages

  • Re: several windowsforms
    ... the Windows Forms Designer adds some code to the body of the ... you don't have to write the connection string as a string literal in your ... Layer, Business Rules Layer and the Presentation Layer,so the Windows Forms ... > Each windowsform has its own connectionstring connecting up to one ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Cant find stored procedure
    ... It is also possible that your connection string point to the wrong database. ... > Could not find stored procedure 'AddNewResumeTemplate '1234',1001,'This is ... > Dim ConnectionString as String ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: How to swapp the default Membership Provider?
    ... Here is the solution I came up with: create own MembershipProvider. ... public static ConnectionStringSettings ConnectionString { ... MyMembershipProvider type with empty connection string. ... provider the provider will choose the right connection string itself. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Getting a custom table based on DB data
    ... TRANSFORM FirstAS FirstOfVALUE ... Dim q,connectionstring As String ... connectionstring = 'just the connection string to my access file ... connectionstring) ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: sql connection string in web.config trouble
    ... What is the connection string you're trying to retrieve from the config? ... Please review the stack trace for more information ... > System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) ...
    (microsoft.public.dotnet.general)