示例#1
0
        internal static MySqlDataReader ExcuteReader(string sqlCmd)
        {
            MySqlConnection con = new MySqlConnection(WebConfigHelper.GetConfig(DefineTable.DatabaseConstr));
            MySqlCommand    cmd = new MySqlCommand(sqlCmd);

            cmd.CommandType = CommandType.Text;
            cmd.Connection  = con;
            con.Open();
            return(cmd.ExecuteReader());
        }
示例#2
0
        internal static int ExecuteNonQuery(string sqlCmd)
        {
            MySqlConnection con = new MySqlConnection(WebConfigHelper.GetConfig(DefineTable.DatabaseConstr));
            MySqlCommand    cmd = new MySqlCommand(sqlCmd);

            cmd.CommandType = CommandType.Text;
            cmd.Connection  = con;
            con.Open();
            int rows = cmd.ExecuteNonQuery();

            con.Close();
            return(rows);
        }