oraclecommand

OracleCommand execution blocks if has OracleDependency

我的未来我决定 提交于 2020-01-15 09:51:28
问题 I have the following code: OracleConnection conn = new OracleConnection(connString); OracleCommand command = new OracleCommand("select * from testtable", conn); conn.Open(); OracleDependency.Port = 2010; OracleDependency dependency = new OracleDependency(command); command.AddRowid = true; command.Notification.IsNotifiedOnce = false; dependency.OnChange += new OnChangeEventHandler(dependency_OnChange); command.CommandTimeout = 1000; DataTable t = new DataTable(); OracleDataAdapter adapter =

OracleCommand timeout

帅比萌擦擦* 提交于 2019-12-23 05:22:09
问题 ODP.NET documentation for OracleCommand.CommandTimeout says Default is 0 seconds, which enforces no time limit. When the specified timeout value expires before a command execution finishes, the command attempts to cancel. If cancellation is successful, an exception is thrown with the message of ORA-01013: user requested cancel of current operation. If the command executed in time without any errors, no exceptions are thrown. In a situation where multiple OracleCommand objects use the same

Performing an Oracle Transaction using C# and ODP.NET

放肆的年华 提交于 2019-12-20 12:29:21
问题 I'm confused. On the face of it, performing a transaction in C# seems simple. From here: http://docs.oracle.com/cd/B19306_01/win.102/b14307/OracleTransactionClass.htm string constr = "User Id=scott;Password=tiger;Data Source=oracle"; OracleConnection con = new OracleConnection(constr); con.Open(); OracleCommand cmd = con.CreateCommand(); cmd.CommandText = "SELECT COUNT(*) FROM MyTable"; // Start a transaction OracleTransaction txn = con.BeginTransaction( IsolationLevel.ReadCommitted); try { /

Performing an Oracle Transaction using C# and ODP.NET

為{幸葍}努か 提交于 2019-12-03 02:35:31
I'm confused. On the face of it, performing a transaction in C# seems simple. From here: http://docs.oracle.com/cd/B19306_01/win.102/b14307/OracleTransactionClass.htm string constr = "User Id=scott;Password=tiger;Data Source=oracle"; OracleConnection con = new OracleConnection(constr); con.Open(); OracleCommand cmd = con.CreateCommand(); cmd.CommandText = "SELECT COUNT(*) FROM MyTable"; // Start a transaction OracleTransaction txn = con.BeginTransaction( IsolationLevel.ReadCommitted); try { // Insert the same row twice into MyTable cmd.CommandText = "INSERT INTO MyTable VALUES (1)"; cmd

OracleCommand command, ExecuteNonQuery issue

℡╲_俬逩灬. 提交于 2019-12-01 19:00:48
I have to clear certain tables in the oracle database however when I'm having issues with running the following code public static void ClearDataTables(IList<string> tableNames) { string connectionString = "CONNECTIONSTRING"; using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); foreach (string table in tableNames) { OracleCommand command = connection.CreateCommand(); string sql = String.Format("DELETE FROM TOA_REPORTING.{0}", table); command.CommandText = sql; command.ExecuteNonQuery(); } connection.Close(); } } I am