locked
OBBC Error RRS feed

  • Question

  • User-151352204 posted

    Hi I am receiving below error -

    Error on machine: SJC1WVD-INFOT01

    System.Exception: DbFactory.FillDataSet() ---> System.Data.Odbc.OdbcException

       at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)

       at System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection, OdbcConnectionString constr, OdbcEnvironmentHandle environmentHandle)

       at System.Data.Odbc.OdbcConnectionOpen..ctor(OdbcConnection outerConnection, OdbcConnectionString connectionOptions)

       at System.Data.Odbc.OdbcConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)

       at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)

       at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)

       at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)

       at System.Data.Odbc.OdbcConnection.Open()

       at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)

       at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

       at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

    I use my sql connector to connect database under odbc adminstrator. Can I known why?

    My connection -

    <add key="DatabaseConnectionString" value="DRIVER={MySQL ODBC 3.51 Driver};SERVER=10.20.28.141;PORT=3306;DATABASE=XXX;USER=XXX;PASSWORD=XXX;OPTION=17923" />

    Wednesday, July 1, 2015 4:02 PM

All replies

  • User197322208 posted

    and the message of the error ?

    Thursday, July 2, 2015 2:01 AM
  • User-84896714 posted

    Hi aditya1986,
    Thank you for your post.
    Mark sure your mysql server is online, and try to change your connection like this.
    string mySQLConnStr = "driver={MySQL};server=127.0.0.1;uid=BARTLETR;pwd=74590000;database=myStore;OPTION=17923";
    You could use Connector/Net instead of ODBC to connect mysql database. It's very easy to use.
    http://dev.mysql.com/downloads/connector/net/
    Hoping my reply could be helpful to you.
    Best Regards,
    Wang Li

    Thursday, July 2, 2015 4:13 AM
  • User-151352204 posted

    System.Exception: DbFactory.FillDataSet() ---> System.Data.Odbc.OdbcException

       at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)

       at System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection, OdbcConnectionString constr, OdbcEnvironmentHandle environmentHandle)

       at System.Data.Odbc.OdbcConnectionOpen..ctor(OdbcConnection outerConnection, OdbcConnectionString connectionOptions)

       at System.Data.Odbc.OdbcConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)

       at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)

       at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)

       at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)

       at System.Data.Odbc.OdbcConnection.Open()

       at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)

       at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

       at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

    Thursday, July 2, 2015 4:39 PM
  • User-1858315090 posted

    Hi Aditya,

    ODBC 3.51 seems to be a pretty older version, are you sure the one you installed is not the latest one - ODBC 5.1?

    Also, I'm not sure if the Key-Value is the correct syntax, try use the following instead:

    <add name="MySQLConnStr" connectionString="DRIVER={MySQL ODBC 5.1 Driver};Server=localhost;Database=YourDatabase;UID=YourUsername;PWD=YourPassword;"/>

    Tuesday, July 14, 2015 5:55 AM