Need help around saving data.

This is a discussion on Need help around saving data. within the C# Programming forums, part of the General Programming Boards category; Hey, I got a windows mobile (the touch screen type) and i have made a program that calculates how many ...

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    3

    Need help around saving data.

    Hey,

    I got a windows mobile (the touch screen type) and i have made a program that calculates how many points (weight watchers) are in food. I then thought it would be awesome if you could save like a weeks worth of food eaten. The put on my thinking hat and i couldn't think of away. Then i put on my google hat and i couldn't find away.

    Also i can't use SQL for some reason i just suck at it. So if that's your solution please write alittle sample code because i have spent hours looking and reading information and i still suck at it.

    Thanks
    -Cory

    ps. Not to technicle :>

  2. #2
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    You could make your class with whatever data is needed, then serialize/deserialize it to save and open. Your class should have the attribute [Serializable] and for ease should have a serialized constructor and implement ISerializable.

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    3

    huh?

    lol,

    First thing is the data is in the entered by the user so i am not sure how i can get that in into the coding. Also i didn't get much of what you said.

    I'll google it all and see if i can will reply if i can understand

    Thanks

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    How are you storing the data as the user enters it?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    Serialization is the process of writing an object with all it's data members to a file. Let's say the information the user enters goes into a class that encapsulates that data, then you can at runtime allow the user to "serialize" the file and the entire class is saved to a file of your choice. You can then deserialize the class which loads the file and allocates a new object for your user to view. I've only learned about saving files that way, maybe there are better ways, but it seems effective enough.

    http://www.codeproject.com/KB/cs/NetSerialization.aspx

  6. #6
    Registered User
    Join Date
    Apr 2008
    Posts
    3
    Im in ist at school atm. Ill try this when i get home.

    Thanks
    -Cory

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 48
    Last Post: 09-26-2008, 04:45 AM
  2. singly linked circular list
    By DarkDot in forum C++ Programming
    Replies: 0
    Last Post: 04-24-2007, 09:55 PM
  3. Saving Data
    By JoeJTaylor in forum C++ Programming
    Replies: 5
    Last Post: 04-22-2006, 10:06 PM
  4. C diamonds and perls :)
    By Carlos in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 05-16-2003, 11:19 PM
  5. Saving data
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 08-01-2002, 09:36 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21