示例#1
0
    public List <imageitem> GetGroupImage(string group)
    {
        List <imageitem> Items2 = new List <imageitem>();

        OpenDBConnection();

        SqlCommand ucommand;

        ucommand = new SqlCommand("SELECT fld_filename FROM dash_image WHERE fld_group = @group AND (fld_Status IS NULL OR fld_Status <> 'D') ORDER BY fld_autoinc", conn);


        ucommand.Parameters.Add(new SqlParameter("group", group));


        using (SqlDataReader reader = ucommand.ExecuteReader())
        {
            while (reader.Read())
            {
                imageitem Item = new imageitem();

                Item.fld_filename = reader["fld_filename"].ToString();
                Items2.Add(Item);
            }
        }
        ucommand.Dispose();
        CloseDBConnection();

        return(Items2);
    }
示例#2
0
    public List <imageitem> Get4Image(string fld_user)
    {
        List <imageitem> Items2 = new List <imageitem>();

        OpenDBConnection();

        SqlCommand ucommand;

        ucommand = new SqlCommand("SELECT TOP 4 * FROM cb_progressimage where fld_user = @user", conn);

        ucommand.Parameters.Add(new SqlParameter("user", fld_user));

        using (SqlDataReader reader = ucommand.ExecuteReader())
        {
            while (reader.Read())
            {
                imageitem Item = new imageitem();

                Item.fld_filename = reader["fld_filename"].ToString();
                Items2.Add(Item);
            }
        }
        return(Items2);
    }