#1: SqlConnectionString/ODBC/VS2008
Posted on 2008-04-24 19:39:52 by GH
I have the following code, in an ASP.NET app, to setup a connection in
code.
string connectionString =
"DSN=Interbase;UID=SYSDBA;DB=C:\\Data\\MEMDATA.GDB;";
SqlConnection con = new SqlConnection(connectionString);
When I try to run the app I get the following error message
System.ArgumentException: Keyword not supported: 'dsn'.
How can I get an ODBC connection, to work with the code above?
TIA
Report this message |
|
#2: Re: SqlConnectionString/ODBC/VS2008
Posted on 2008-04-24 19:54:52 by Courtney
"gh" <gh@att.net> wrote in message
news:uYNh3IjpIHA.1772@TK2MSFTNGP03.phx.gbl...
>I have the following code, in an ASP.NET app, to setup a connection in
> code.
>
> string connectionString =
> "DSN=Interbase;UID=SYSDBA;DB=C:\\Data\\MEMDATA.GDB;";
> SqlConnection con = new SqlConnection(connectionString);
>
> When I try to run the app I get the following error message
>
> System.ArgumentException: Keyword not supported: 'dsn'.
>
> How can I get an ODBC connection, to work with the code above?
>
> TIA
Not sure what answer is but check out this page it has as many possible
connection strings as I have seen:
http://www.carlprothman.net/Default.aspx?tabid=81
LS
Report this message |
#3: Re: SqlConnectionString/ODBC/VS2008
Posted on 2008-04-24 19:59:59 by George Ter-Saakov
The SqlConnection is only for MS SQL server.
If you using DSN then you need to use OdbcConnection class
George
"gh" <gh@att.net> wrote in message
news:uYNh3IjpIHA.1772@TK2MSFTNGP03.phx.gbl...
>I have the following code, in an ASP.NET app, to setup a connection in
> code.
>
> string connectionString =
> "DSN=Interbase;UID=SYSDBA;DB=C:\\Data\\MEMDATA.GDB;";
> SqlConnection con = new SqlConnection(connectionString);
>
> When I try to run the app I get the following error message
>
> System.ArgumentException: Keyword not supported: 'dsn'.
>
> How can I get an ODBC connection, to work with the code above?
>
> TIA
Report this message |
#4: Re: SqlConnectionString/ODBC/VS2008
Posted on 2008-04-24 22:49:16 by mark
"gh" <gh@att.net> wrote in message
news:uYNh3IjpIHA.1772@TK2MSFTNGP03.phx.gbl...
??
>I have the following code, in an ASP.NET app, to setup a connection in
> code.
>
> string connectionString =
> "DSN=Interbase;UID=SYSDBA;DB=C:\\Data\\MEMDATA.GDB;";
> SqlConnection con = new SqlConnection(connectionString);
>
> When I try to run the app I get the following error message
>
> System.ArgumentException: Keyword not supported: 'dsn'.
>
> How can I get an ODBC connection, to work with the code above?
You're using SqlConnection - that's only for SQL Server. If you absolutely
must use ODBC, then you need OdbcConnection.
But why are you trying to use ODBC when there is a perfectly good native
..NET data provider available...?
http://cc.codegear.com/item/25298
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Report this message |