D
Darryn Ross
Hi...
I am trying to trying to execute a database reader and i keep getting the
following exception error...
{"IErrorInfo.GetDescription failed with E_FAIL(0x80004005)." }
System.Exception
I have not idea what this error means, or how to resolve the issue, if you
have any suggestions please let me know. The code i am running is as
follows....
int ID = 0 ;
OleDbConnection Connection = new OleDbConnection() ;
try {
//Database Connection
Connection.ConnectionString = AppMain.CompanyConnectionPath ;
OleDbCommand Command = new OleDbCommand("Select * From tbl WHERE LOWER <=" +
51.01 + " AND UPPER >=" + 51.01, Connection) ;
//Open the connection
Connection.Open();
//Create an instance of a data reader
OleDbDataReader Reader ;
//Setup data reader CommandBehavior.CloseConnection
Reader = Command.ExecuteReader(CommandBehavior.CloseConnection) ; // error
occurs here!
while(Reader.Read()) {
//Chart of Accounts Information
pID = Convert.ToInt32(Reader["ID"]) ;
}
Reader.Close() ;
Command.Dispose() ;
}
catch(Exception e) {
MessageBox.Show(e.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error) ;
}
finally {
Connection.Close() ;
}
return pID ;
I am trying to trying to execute a database reader and i keep getting the
following exception error...
{"IErrorInfo.GetDescription failed with E_FAIL(0x80004005)." }
System.Exception
I have not idea what this error means, or how to resolve the issue, if you
have any suggestions please let me know. The code i am running is as
follows....
int ID = 0 ;
OleDbConnection Connection = new OleDbConnection() ;
try {
//Database Connection
Connection.ConnectionString = AppMain.CompanyConnectionPath ;
OleDbCommand Command = new OleDbCommand("Select * From tbl WHERE LOWER <=" +
51.01 + " AND UPPER >=" + 51.01, Connection) ;
//Open the connection
Connection.Open();
//Create an instance of a data reader
OleDbDataReader Reader ;
//Setup data reader CommandBehavior.CloseConnection
Reader = Command.ExecuteReader(CommandBehavior.CloseConnection) ; // error
occurs here!
while(Reader.Read()) {
//Chart of Accounts Information
pID = Convert.ToInt32(Reader["ID"]) ;
}
Reader.Close() ;
Command.Dispose() ;
}
catch(Exception e) {
MessageBox.Show(e.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error) ;
}
finally {
Connection.Close() ;
}
return pID ;