as.net localsqlserver odbc connection

  • Does anyone know if how to change the localsqlserver connection string to use an odbc connection? If I use the connection string that works for a gridview, I get the following error:

    [ArgumentException: Keyword not supported: 'dsn'.]   System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +417   System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +99   System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +52   System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +25   System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +141   System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) +38   System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +4   System.Data.SqlClient.SqlConnection..ctor(String connectionString) +21   System.Web.DataAccess.SqlConnectionHolder..ctor(String connectionString) +38

    <

    remove name="LocalSqlServer" />

    <add name="LocalSqlServer" connectionString="Dsn=ASPNETDB;uid=LOGIN;pwd=PASSWORD" providerName="System.Data.Odbc"  />

    <add name="Test" connectionString="Dsn=Test;uid=LOGIN;pwd=PASSWORD" providerName="System.Data.Odbc" />

     

    The "Test" dataconnection works with the GridView.

  • try to create a UDL fiel and use the information from the UDL file to create a connectionstring

    Cheers,
    Sugeshkumar Rajendran
    SQL Server MVP
    http://sugeshkr.blogspot.com

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply