This is my code so far....
Expand|Select|Wrap|Line Numbers
- // Connection to Oracle DB
- int connectionCounter = 0;
- bool boolUpdateData = true;
- while (boolUpdateData && connectionCounter < 3)
- {
- try
- {
- localConnection = new OracleConnection(localFunction.localConnectionString);
- localConnection.Open();
- boolUpdateData = false;
- }
- catch (Exception localException)
- {
- localFunction.WriteEventLog(localException.ToString(), "OPCAlarmConfig");
- }
- connectionCounter++;
- }
- localSQL = @"SELECT * FROM SYS_LINE";
- localFunction.ExecuteOracleNonQuery(localSQL, localConnection, "OPCAlarmConfig");
- // Update Oracle DB
- try {
- OracleCommandBuilder cb = new OracleCommandBuilder(oleda);
- userTable = ds.Tables["SYS_LINE"];
- oleda.Fill(ds,"SYS_LINE");
- excelGridView.DataSource = ds.Tables[0];
- oleda.Update(ds, "SYS_LINE");
- }
- catch (Exception imptoracle)
- { MessageBox.Show(imptoracle.ToString()); }
- }
This exception error "Object reference not set to an instance of an object" kept appearing on the "oleda.Fill(ds,"SYS_LINE");" line
Can anyone help?