• mysql 套事物实例


    public static DataSet GetPPriceList(string aircompany, string departPort, string arrivePort, string cabin,Boolean flag=false)
            {
                string sql = "SELECT ID, AirCompany,DepartCode,ArriveCode,ServerGrade,Cabin,Price,Agio,SaleBeginTime,SaleEndTime,TravelBeginTime,TravelEndTime FROM PPrice WHERE `Status`=1 AND SaleEndTime>NOW() AND TravelEndTime>NOW()  ";
                if (aircompany != "")
                {
                    sql += " and AirCompany='" + aircompany + "' ";
                }
                if (departPort != "")
                {
                    sql += " and DepartCode='" + departPort + "' ";
                }
                if (arrivePort != "")
                {
                    sql += " and ArriveCode='" + arrivePort + "' ";
                }
                if (cabin != "")
                {
                    sql += " and Cabin='" + cabin + "'";
                }
                sql += " ORDER BY ModifyTime DESC ";
                DataSet ds = null;
                using (MySql.Data.MySqlClient.MySqlConnection conn = new MySql.Data.MySqlClient.MySqlConnection(MySqlHelper.ConnectionString))
                {
                    if (ConnectionState.Open != conn.State)
                        conn.Open();
                    if (flag)
                    {
                        MySql.Data.MySqlClient.MySqlTransaction tra = conn.BeginTransaction(IsolationLevel.ReadUncommitted);
                        ds = MySqlHelper.ExecuteDataset(tra, CommandType.Text, sql);
                        tra.Commit();
                    }
                    else
                    {
                        ds = MySqlHelper.ExecuteDataset(conn, CommandType.Text, sql);
                    }
                }
                return ds;
            }
  • 相关阅读:
    产品生成器模块的问题图片处理
    jQueryinteface效果集合
    aspx页面中文汉字显示为乱码
    实用的正则表达式
    用javascript操作xml
    标注上下标的方法
    1740 博弈
    1028 母函数
    To resolve the problem of sharepoint can not login
    Modify Sharepoint Login UI
  • 原文地址:https://www.cnblogs.com/honghong75042/p/3503216.html
Copyright © 2020-2023  润新知