OracleDataReader undeclared identifier error
-
I have a function that queries an Oracle DB. For some reason I receive two errors on each statement in my __finally block. Is there something wrong with my declarations? Errors: error C2065: 'myReader' : undeclared identifier error C2227: left of '->Close' must point to class/struct/union/generic type error C2065: 'myOracleConnection' : undeclared identifier error C2227: left of '->Close' must point to class/struct/union/generic type My code that generates the errors: cPacket ^queryPacket(String ^cmd, String ^con) { //test if the passed arguments are empty if(con->Equals("")) { MessageBox::Show("Oracle Connection String Empty o.O","Error in Form1::queryPacket"); } if(cmd->Equals("")) { MessageBox::Show("Oracle Command String Empty o.O","Error in Form1::queryPacket"); } try { OracleConnection ^myOracleConnection = gcnew OracleConnection(con); OracleCommand ^myOracleCommand = gcnew OracleCommand(cmd, myOracleConnection); myOracleConnection->Open(); OracleDataReader ^myReader = myOracleCommand->ExecuteReader(CommandBehavior::CloseConnection); myReader->Close();//I put this in here to debug. The statement doesnt throw any errors and inteliSense picks up the myReader object so I'm assuming that it works fine. }//end try catch (Exception ^ex) { MessageBox::Show(ex->Message,"Exception in class PaCCaP's function queryPacket", MessageBoxButtons::OK, MessageBoxIcon::Exclamation); }//end catch __finally { myReader->Close(); //this is where the first 2 errors are generated myOracleConnection->Close(); //and the second 2 }//end finally I'm hoping this is something small that I've overlooked, possibly in my declarations? Also, It It's not too much to ask, How do you create a 1-dimensional array of objects in the 2005 syntax (I just switched over from 2003 and trackable ^ pointers are a bit fuzzy to me. All suggestions are appreciated. Thanks!
-
I have a function that queries an Oracle DB. For some reason I receive two errors on each statement in my __finally block. Is there something wrong with my declarations? Errors: error C2065: 'myReader' : undeclared identifier error C2227: left of '->Close' must point to class/struct/union/generic type error C2065: 'myOracleConnection' : undeclared identifier error C2227: left of '->Close' must point to class/struct/union/generic type My code that generates the errors: cPacket ^queryPacket(String ^cmd, String ^con) { //test if the passed arguments are empty if(con->Equals("")) { MessageBox::Show("Oracle Connection String Empty o.O","Error in Form1::queryPacket"); } if(cmd->Equals("")) { MessageBox::Show("Oracle Command String Empty o.O","Error in Form1::queryPacket"); } try { OracleConnection ^myOracleConnection = gcnew OracleConnection(con); OracleCommand ^myOracleCommand = gcnew OracleCommand(cmd, myOracleConnection); myOracleConnection->Open(); OracleDataReader ^myReader = myOracleCommand->ExecuteReader(CommandBehavior::CloseConnection); myReader->Close();//I put this in here to debug. The statement doesnt throw any errors and inteliSense picks up the myReader object so I'm assuming that it works fine. }//end try catch (Exception ^ex) { MessageBox::Show(ex->Message,"Exception in class PaCCaP's function queryPacket", MessageBoxButtons::OK, MessageBoxIcon::Exclamation); }//end catch __finally { myReader->Close(); //this is where the first 2 errors are generated myOracleConnection->Close(); //and the second 2 }//end finally I'm hoping this is something small that I've overlooked, possibly in my declarations? Also, It It's not too much to ask, How do you create a 1-dimensional array of objects in the 2005 syntax (I just switched over from 2003 and trackable ^ pointers are a bit fuzzy to me. All suggestions are appreciated. Thanks!
-
I have a function that queries an Oracle DB. For some reason I receive two errors on each statement in my __finally block. Is there something wrong with my declarations? Errors: error C2065: 'myReader' : undeclared identifier error C2227: left of '->Close' must point to class/struct/union/generic type error C2065: 'myOracleConnection' : undeclared identifier error C2227: left of '->Close' must point to class/struct/union/generic type My code that generates the errors: cPacket ^queryPacket(String ^cmd, String ^con) { //test if the passed arguments are empty if(con->Equals("")) { MessageBox::Show("Oracle Connection String Empty o.O","Error in Form1::queryPacket"); } if(cmd->Equals("")) { MessageBox::Show("Oracle Command String Empty o.O","Error in Form1::queryPacket"); } try { OracleConnection ^myOracleConnection = gcnew OracleConnection(con); OracleCommand ^myOracleCommand = gcnew OracleCommand(cmd, myOracleConnection); myOracleConnection->Open(); OracleDataReader ^myReader = myOracleCommand->ExecuteReader(CommandBehavior::CloseConnection); myReader->Close();//I put this in here to debug. The statement doesnt throw any errors and inteliSense picks up the myReader object so I'm assuming that it works fine. }//end try catch (Exception ^ex) { MessageBox::Show(ex->Message,"Exception in class PaCCaP's function queryPacket", MessageBoxButtons::OK, MessageBoxIcon::Exclamation); }//end catch __finally { myReader->Close(); //this is where the first 2 errors are generated myOracleConnection->Close(); //and the second 2 }//end finally I'm hoping this is something small that I've overlooked, possibly in my declarations? Also, It It's not too much to ask, How do you create a 1-dimensional array of objects in the 2005 syntax (I just switched over from 2003 and trackable ^ pointers are a bit fuzzy to me. All suggestions are appreciated. Thanks!
-
cpp_and_asm wrote:
How do you create a 1-dimensional array of objects in the 2005 syntax
I think this is it
array^ myarray = gcnew array(size goes here);
System.IO.Path.IsPathRooted() does not behave as I would expect