关于c#.net oracle 中联系执行多条sql语句的问题

用c#.net 执行多条sql语句要加


begin

    sql1;

    sql2;

    sql3;

    slq4;

  end;



然后用


  conn.Open();
                OracleCommand cmd = new OracleCommand();
                cmd.Connection = conn;
                OracleTransaction tx = conn.BeginTransaction();
                cmd.Transaction = tx;
                try
                {
                   cmd.CommandText = SqlListString;
                   cmd.ExecuteNonQuery();
                   tx.Commit();
                }
                catch (System.Data.OracleClient.OracleException E)
                {
                    tx.Rollback();
                    throw new Exception(E.Message);
                }

不然容易报 oracle ORA-00911: invalid character 错误


已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页