/// <summary>
/// 执行SQL语句,返回影响的记录数
/// </summary>
/// <param name="SQLString">SQL语句</param>
/// <returns>影响的记录数</returns>
public static int ExecuteSql(string SQLString, string _oraConn)
{
using (OracleConnection connection = new OracleConnection(_oraConn))
{
try
{
OracleCommand cmd = new OracleCommand(SQLString, connection);
connection.Open();
int rows = cmd.ExecuteNonQuery();
return rows;
}
catch (Exception E)
{
connection.Close();
throw new Exception("DbHelperOra.ExecuteSql" + E.Message);
}
}
} |