SqlConnectionString\ODBC\VS2008

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
 
L

Lloyd Sheen

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
 
G

George Ter-Saakov

The SqlConnection is only for MS SQL server.
If you using DSN then you need to use OdbcConnection class

George
 
G

gh

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,225
Members
46,815
Latest member
treekmostly22

Latest Threads

Top