SqlConnectionString\ODBC\VS2008

  • Thread starter Thread starter gh
  • Start date Start date
G

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
 
gh said:
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
 
The SqlConnection is only for MS SQL server.
If you using DSN then you need to use OdbcConnection class

George
 
Mark said:
??

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:;
I have the bdp driver installed. I added the bdp connection, adapter to
my toolbox, but in my asp,net app they are grayed out. Any idea what
would cause this? I am using VS 2008 and C#.

TIA
 
Back
Top