标签:oracl comm ons nbsp pen except jks apt man
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 = 0; 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(); }
标签:oracl comm ons nbsp pen except jks apt man
原文地址:http://www.cnblogs.com/leolzi/p/7985824.html