store data in .net mobile app

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mag66
    New Member
    • Dec 2009
    • 4

    store data in .net mobile app

    Hello everyone,
    I want to develop app in .net mobile that would store data, and retrieve it. For example, a user would choose a food item from a list, and the app would display calorie info for the item from database table. Would anyone have any idea how I could go about doing this? I've been playing with DataTable but I'm not sure if it the right way to do it. I'm a beginner in mobile deb :(

    Thank you.
  • markmcgookin
    Recognized Expert Contributor
    • Dec 2006
    • 648

    #2
    Your best bet is to look into using SQL Server CE (Compact Edition) which is a free resource with Visual Studio.

    You can create a .sdf file as your database on the device and store information in it, and retrieve it with simple SQL queries based on your user's input.

    A quick google/search on bytes.com should land you some useful links on how to do this. Something like "SQL Server CE Windows Mobile" should return a bunch of results. If you have any issues, post back here and we will see if we can help you out.

    Comment

    • mag66
      New Member
      • Dec 2009
      • 4

      #3
      Thank you for your reply. I came across SQL Server CE in my reserach; however I'm wondering about one thing: I wouldn't have any problem with installing it on my laptop, but I have to present this application on a computer that doesn't have SQL Server CE installed. I'm guessing the app wouldn't run then, am I right?

      Comment

      • markmcgookin
        Recognized Expert Contributor
        • Dec 2006
        • 648

        #4
        Are you running this on a PDA or on a laptop?

        Comment

        • mag66
          New Member
          • Dec 2009
          • 4

          #5
          I'm running the app on my laptop in visual studio using emulator.

          Comment

          • markmcgookin
            Recognized Expert Contributor
            • Dec 2006
            • 648

            #6
            Ah right, so the "PDA" in the emulator is where the SQL Server CE needs to be installed. There are DLLs included with VS that you can include with your Smart Device project to allow it to run SQL Server CE on the Emulator, as it would run on the PDA.

            Try reading through this MSDN tutorial on how to connect to SQL Server CE using windows mobile and c#


            EDIT - Infact... that's too complex. Forget that tutorial. Its a lot simpler than that. You can create an sdf file and populate it with SQL on the device if you want. Or connect to it through SQL server management studio. SQL Server CE runs on the DEVICE/EMULATOR allowing apps to work when they are not connected to anything.

            Comment

            • markmcgookin
              Recognized Expert Contributor
              • Dec 2006
              • 648

              #7
              Aha.. this one is a bit more of a useful tutorial....

              Read through this carefully and follow it, use the source code only if you get stuck (its always best to learn rather than copy!)

              Tutorial

              Comment

              • mag66
                New Member
                • Dec 2009
                • 4

                #8
                ok. Thank you very much!! I'll give it a try.

                Comment

                Working...