SqlConnectionString\ODBC\VS2008

Discussion in 'ASP .Net' started by gh, Apr 24, 2008.

  1. gh

    gh Guest

    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, Apr 24, 2008
    #1
    1. Advertising

  2. gh

    Lloyd Sheen Guest

    "gh" <> wrote in message
    news:...
    >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
     
    Lloyd Sheen, Apr 24, 2008
    #2
    1. Advertising

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

    George


    "gh" <> wrote in message
    news:...
    >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
     
    George Ter-Saakov, Apr 24, 2008
    #3
  4. gh

    gh Guest

    Mark Rae [MVP] wrote:
    > "gh" <> wrote in message
    > news:...
    > ??
    >> 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
     
    gh, May 5, 2008
    #4
  5. gh

    gh Guest

    Mark Rae [MVP] wrote:
    > "gh" <> wrote in message
    > news:...
    >
    >>>> 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
     
    gh, May 6, 2008
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luis Esteban Valencia

    Encrypt sqlconnectionstring on XML files

    Luis Esteban Valencia, Jul 8, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    828
    Peter Rilling
    Jul 9, 2005
  2. Hans Kesting

    vs2008 hangs when building solution

    Hans Kesting, Sep 24, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    637
    Teemu Keiski
    Sep 24, 2007
  3. shapper

    LINQ in VS2008

    shapper, Oct 15, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    363
    Patrice
    Oct 15, 2007
  4. ikari

    WebControl with VS2008

    ikari, Oct 26, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    1,330
    Teemu Keiski
    Nov 1, 2007
  5. Wes Gamble
    Replies:
    1
    Views:
    163
    Gerardo Santana Gómez Garrido
    Apr 5, 2006
Loading...

Share This Page