Click here to Skip to main content
15,886,518 members
Home / Discussions / C#
   

C#

 
QuestionConstrained generic class concepts Pin
Member 99394238-Apr-13 20:55
Member 99394238-Apr-13 20:55 
QuestionConstrained object in C# Pin
Member 99394238-Apr-13 20:52
Member 99394238-Apr-13 20:52 
AnswerRe: Constrained object in C# Pin
Pete O'Hanlon8-Apr-13 22:51
mvePete O'Hanlon8-Apr-13 22:51 
QuestionCan I display links in a ListView's detail mode? Pin
NarVish8-Apr-13 20:33
NarVish8-Apr-13 20:33 
Questionc# application don't work on xp Pin
Member 99694278-Apr-13 10:39
Member 99694278-Apr-13 10:39 
AnswerRe: c# application don't work on xp Pin
fjdiewornncalwe8-Apr-13 10:54
professionalfjdiewornncalwe8-Apr-13 10:54 
AnswerRe: c# application don't work on xp Pin
Manfred Rudolf Bihy8-Apr-13 20:02
professionalManfred Rudolf Bihy8-Apr-13 20:02 
Questionadvanced settings Pin
bfis1081378-Apr-13 10:13
bfis1081378-Apr-13 10:13 
I want to save a collection of custom objects. It seems that I succeed but when I try to retrieve the setting after the program restarts, the data is gone. I have searched extensively for the solution but to no avail. Here is what I have. Any help would be deeply appreciated.

In my settings.cs file I have added the following code.
C#
[global::System.Configuration.UserScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public List<Account> Accounts
        {
            get
            {
                return ((List<Account>)(this["Accounts"]));
            }
            set
            {
                this["Accounts"] = value;
            }
        }


Then I have the class marked as serializable. I have the following code at window close and as you can see it does compile so it picks up on the code and the data is there after I save it using the debugger to verify.

C#
Properties.Settings.Default.Accounts = accounts.List;
            Properties.Settings.Default.Save();


All should be ok when I run the following code except the data just isn't there as it has a value of null.

C#
if (Properties.Settings.Default.Accounts != null)
            {
                accounts.List = Properties.Settings.Default.Accounts;
            }

AnswerRe: advanced settings Pin
SledgeHammer018-Apr-13 10:15
SledgeHammer018-Apr-13 10:15 
GeneralRe: advanced settings Pin
bfis1081378-Apr-13 10:18
bfis1081378-Apr-13 10:18 
GeneralRe: advanced settings Pin
SledgeHammer018-Apr-13 11:16
SledgeHammer018-Apr-13 11:16 
GeneralRe: advanced settings Pin
bfis1081378-Apr-13 18:22
bfis1081378-Apr-13 18:22 
GeneralRe: advanced settings Pin
SledgeHammer018-Apr-13 18:33
SledgeHammer018-Apr-13 18:33 
GeneralRe: advanced settings Pin
bfis1081378-Apr-13 18:45
bfis1081378-Apr-13 18:45 
GeneralRe: advanced settings Pin
SledgeHammer018-Apr-13 18:48
SledgeHammer018-Apr-13 18:48 
GeneralRe: advanced settings Pin
bfis1081378-Apr-13 18:51
bfis1081378-Apr-13 18:51 
GeneralRe: advanced settings Pin
SledgeHammer018-Apr-13 19:08
SledgeHammer018-Apr-13 19:08 
GeneralRe: advanced settings Pin
bfis1081378-Apr-13 21:16
bfis1081378-Apr-13 21:16 
AnswerRe: advanced settings Pin
Alan N9-Apr-13 1:54
Alan N9-Apr-13 1:54 
GeneralRe: advanced settings Pin
bfis1081379-Apr-13 2:03
bfis1081379-Apr-13 2:03 
GeneralRe: advanced settings Pin
Alan N9-Apr-13 2:31
Alan N9-Apr-13 2:31 
GeneralRe: advanced settings Pin
bfis1081378-Apr-13 21:47
bfis1081378-Apr-13 21:47 
Questioncrystal report problem remove one row Pin
mhd.sbt8-Apr-13 8:30
mhd.sbt8-Apr-13 8:30 
AnswerRe: crystal report problem remove one row Pin
Sivaraman Dhamodharan8-Apr-13 17:29
Sivaraman Dhamodharan8-Apr-13 17:29 
GeneralRe: crystal report problem remove one row Pin
Member 99567779-Apr-13 0:19
Member 99567779-Apr-13 0:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.