473,397 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

SqlConnectionString\ODBC\VS2008

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
Jun 27 '08 #1
7 1965

"gh" <gh@att.netwrote in message
news:uY**************@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

Jun 27 '08 #2
The SqlConnection is only for MS SQL server.
If you using DSN then you need to use OdbcConnection class

George
"gh" <gh@att.netwrote in message
news:uY**************@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

Jun 27 '08 #3
"gh" <gh@att.netwrote in message
news:uY**************@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

Jun 27 '08 #4
gh
Mark Rae [MVP] wrote:
"gh" <gh@att.netwrote in message
news:uY**************@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:;
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
Jun 27 '08 #5
"gh" <gh@att.netwrote in message
news:eu**************@TK2MSFTNGP03.phx.gbl...
>>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
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#.
BDP? Do you mean the Borland Data Provider...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #6
gh
Mark Rae [MVP] wrote:
"gh" <gh@att.netwrote in message
news:eu**************@TK2MSFTNGP03.phx.gbl...
>>>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
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#.

BDP? Do you mean the Borland Data Provider...?

Mark:

Yes.

Thanks
Jun 27 '08 #7
"gh" <gh@att.netwrote in message
news:u0*************@TK2MSFTNGP06.phx.gbl...
>>>>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

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#.

BDP? Do you mean the Borland Data Provider...?

Yes.
OK, as has been mentioned previously, SqlConnection is *ONLY* for Microsoft
SQL Server - trying to use it with another RDBMS is not going to work.

Since you're using the Borland Data Provider, I'm assuming that you're
trying to connect to Borland InterBase. If so, then there is no need for
OleDb or <shuddersODBC, as there is a perfectly good native .NET data
provider available - you can find everything you need (including code
samples) here: http://dn.codegear.com/article/31939
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.