Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Windows Phone Mango database support: actually pretty good

DZone's Guide to

Windows Phone Mango database support: actually pretty good

· Mobile Zone
Free Resource

Download this comprehensive Mobile Testing Reference Guide to help prioritize which mobile devices and OSs to test against, brought to you in partnership with Sauce Labs.

Back in June, WindowsPhoneGeek wrote a popular post walking Windows 7.1 developers through creating a simple Local Database application (for storing strings).

A few months later, on September 23rd, Microsoft published their own step-by-step HowTo

(for a to-do list). (The rest of Microsoft's Local Database documentation is probably worth reading/bookmarking too.)

WindowsPhoneGeek's guide is a little easier to follow, because it doesn't explain each step very much. Microsoft's guide explains its code at a fairly low level, so it demands a bit of concentration (like a lot of MSDN documentation).

Now Mark Arteaga has written his own Mango database HowTo, falling somewhere in between those two: clear and a little chatty, and emphasizing the Mango-specific aspects of the code (with spotlighting 'here's something to notice!' comments sprinkled throughout).

Here's how Mark puts his guide in the context of other documentation:

Couple things to cover:

  • Connection strings: to get all the details on Connection String and Local Database on Windows Phone see MSDN.  But one key thing to notice is isostore which is unique to Windows Phone
    • isostore: this essentially means your database was created in code, is read/write and located in isolated storage for your app
    • appdata: this essentially means your database was included in your application, is in the installation folder and is read only.  You can copy this file into Isolated Storage to make it read/write.
  • Initialize – we call this so we can check to see if the database exists and if it does not create it. 
  • Updating Database – I don’t go through this as it’s another post on it’s own.  Read this on MSDN on updating a local database on Windows Phone, it’s a must read!

This is a solid introduction to Windows Phone 7.5's database support. Check it out here.

Analysts agree that a mix of emulators/simulators and real devices are necessary to optimize your mobile app testing - learn more in this white paper, brought to you in partnership with Sauce Labs.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}