数据库 oracle 函数
static OracleConnection mQracleConnecting = null; public static OracleConnection QracleConnecting { get { try { if(mQracleConnecting ==null) mQracleConnecting = new OracleConnection(jksg); if (mQracleConnecting.State != ConnectionState.Open) mQracleConnecting.Open(); return mQracleConnecting; } catch (Exception) { return null; } } } public static DataTable DBGetDataTable(string sql,string conn) { DataTable dataSet = new DataTable(); OracleDataAdapter OraDA = new OracleDataAdapter(sql, conn); OraDA.Fill(dataSet); return dataSet; } public static DataTable DBGetDataTable(string sql, OracleConnection conn) { DataTable dataSet = new DataTable(); OracleDataAdapter OraDA = new OracleDataAdapter(sql, conn); OraDA.Fill(dataSet); return dataSet; } // 执行SQL语句,返回所影响的行数 public static int ExecuteSQL(string sql) { int Cmd = ; OracleCommand command = new OracleCommand(sql, QracleConnecting); try { Cmd = command.ExecuteNonQuery(); } catch { } return Cmd; } public static int ExecuteSQL_Update(string sql) { OracleDataAdapter OraDA = new OracleDataAdapter(sql, QracleConnecting); return OraDA.UpdateCommand.ExecuteNonQuery(); } public static int ExecuteSQL_Insert(string sql) { OracleDataAdapter OraDA = new OracleDataAdapter(sql, QracleConnecting); return OraDA.InsertCommand.ExecuteNonQuery(); }
相关推荐
Omega 2020-08-16
娜娜 2020-07-28
goodriver 2020-06-17
Justdoit00 2020-06-01
Justdoit00 2020-07-04
sunboy 2020-06-14
LuoXinLoves 2020-06-10
Justdoit00 2020-06-08
Justdoit00 2020-06-08
娜娜 2020-06-08
oraclemch 2020-05-30
bianxq 2020-05-16
sunboy 2020-02-20
ktyl000 2020-02-20
一昕之代码 2020-02-20
LuoXinLoves 2020-05-04
点滴技术生活 2020-04-27
oraclemch 2020-04-22
Carlos 2020-04-18