Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SqlConnectionString\ODBC\VS2008

0 views
Skip to first unread message

gh

unread,
Apr 24, 2008, 1:39:52 PM4/24/08
to
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

Lloyd Sheen

unread,
Apr 24, 2008, 1:54:52 PM4/24/08
to

"gh" <g...@att.net> wrote in message
news:uYNh3Ijp...@TK2MSFTNGP03.phx.gbl...

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

George Ter-Saakov

unread,
Apr 24, 2008, 1:59:59 PM4/24/08
to
The SqlConnection is only for MS SQL server.
If you using DSN then you need to use OdbcConnection class

George


"gh" <g...@att.net> wrote in message
news:uYNh3Ijp...@TK2MSFTNGP03.phx.gbl...

Mark Rae [MVP]

unread,
Apr 24, 2008, 4:49:16 PM4/24/08
to
"gh" <g...@att.net> wrote in message
news:uYNh3Ijp...@TK2MSFTNGP03.phx.gbl...
??

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

gh

unread,
May 5, 2008, 1:06:37 PM5/5/08
to
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

Mark Rae [MVP]

unread,
May 5, 2008, 1:17:59 PM5/5/08
to
"gh" <g...@att.net> wrote in message
news:eulpoJtr...@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...?

gh

unread,
May 6, 2008, 6:56:52 AM5/6/08
to
Mark:

Yes.

Thanks

Mark Rae [MVP]

unread,
May 6, 2008, 8:32:21 AM5/6/08
to
"gh" <g...@att.net> wrote in message
news:u0bBmf2...@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 <shudders> ODBC, 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

0 new messages