Does anyone have any code samples that they are willing to share that successfully launches Oracle stored procedures? Here is what I have so far
try
{
string connStr = "Data Source=" + dbServer + ";USER ID=" + dbUser + ";Password=" + dbPass + ";Pooling=False;";
//"User ID=" + dbUser + ";password = " + dbPass + ";server= " + dbServer + ";Initial Catalog=" + dbName + ";Pooling=False";
OracleConnection oracle = new OracleConnection(connStr);
OracleCommand oracleCmd;
oracle.Open();
oracleCmd = new OracleCommand("add_seq_numbers",oracle);
oracleCmd.CommandType = CommandType.StoredProcedure;
oracleCmd.ExecuteNonQuery();
.
.
.
oracle.Dispose();
}
catch (System.Security.SecurityException ex)
{
// Let the user know the save failed.
writeToLogFile(ex + "Permission to the CVIEW database was denied!");
m_streamWriter.Flush();
m_streamWriter.Close();
fs.Close();
error = true;
}
catch (System.Exception ex)
{
// React to other exceptions here.
writeToLogFile("Error " + ex.ToString());
m_streamWriter.Flush();
m_streamWriter.Close();
fs.Close();
error = true;
}
But this does not seem to work on an Oracle system.
try
{
string connStr = "Data Source=" + dbServer + ";USER ID=" + dbUser + ";Password=" + dbPass + ";Pooling=False;";
//"User ID=" + dbUser + ";password = " + dbPass + ";server= " + dbServer + ";Initial Catalog=" + dbName + ";Pooling=False";
OracleConnection oracle = new OracleConnection(connStr);
OracleCommand oracleCmd;
oracle.Open();
oracleCmd = new OracleCommand("add_seq_numbers",oracle);
oracleCmd.CommandType = CommandType.StoredProcedure;
oracleCmd.ExecuteNonQuery();
.
.
.
oracle.Dispose();
}
catch (System.Security.SecurityException ex)
{
// Let the user know the save failed.
writeToLogFile(ex + "Permission to the CVIEW database was denied!");
m_streamWriter.Flush();
m_streamWriter.Close();
fs.Close();
error = true;
}
catch (System.Exception ex)
{
// React to other exceptions here.
writeToLogFile("Error " + ex.ToString());
m_streamWriter.Flush();
m_streamWriter.Close();
fs.Close();
error = true;
}
But this does not seem to work on an Oracle system.