views:

56

answers:

4
  1. What is the native database the windows phone use like (coredata and sql-light in the iphone)
  2. Do you know a manual that explain how to use those DB's... preferably with code samples.

    • I don't like to use DBs no matter how good they are if they are not considered main stream such that I can trust future microsoft versions support (I know that I can't trust nothing - yet, I prefer playing safe)

Thanks Asaf

+1  A: 

If you are using .NET Compact framework, there is the Sql Server Compact Edition. As for the manuals, you can always find something related to this on MSDN. (I am not sure what you mean by native database.)

Abhijeet Kashnia
@Abhijeet : Native means the database is already installed on every windows phone... out of the box, without the need to install anything else by me or the user. Does the sql-server compact framwork is part of the windows phone os? (or basic software)
Asaf
No, I think sql server compact edition needs to be installed with an installer. Just wondering why you need a native database?
Abhijeet Kashnia
First I don't know what I need at the moment. Yet I dont think that a user will appriciate long installations or big frameworks installations. Another thing is the fact that if microsoft has it's own DB or one that it recomand using - it feels safe. (I am new to the mobile world and these questions are coming from a place of knowing nothing about this world :( )
Asaf
From what I remember, the installation was neither long nor is it big. It has to be small (size) so that it can run on a mobile device. However, if your end user has to do a device hard reset, it erases all installed programs from the device, and that's when the user will be forced to reinstall the framework to run your application. Disclaimer: All of my information above is from a Pre Windows Phone 7 world.
Abhijeet Kashnia
Actually SQL COmpact is already built in to the device - you just can't yet use it from 3rd party applications.
ctacke
A: 

There may be examples of Perst for Windows Phone 7 or other C# ports of SQL-like Database implementations in this is for Windows Phone 7 - access to SQL CE on the phone is currently unavailable to developers at this time. Look for some examples of these being used and you'll find most of the information on these. SQL CE for Windows Phone 7 may be available at some point in the future for developers, however nothing has been announced or confirmed regarding this.

RoguePlanetoid
+2  A: 

Currently, Windos Phone 7 does not come with native database support for developers. You have 3 options for storing data: 1. Use the isolated storage of the phone 2. Store your data using a cloud service 3. user a non-native db such as Perst.

If you have a small amount of data, then serialize it to xml or json file, and store it on the isolated storage of the phone.

If your data is large, you will need to use a cloud service or a database such as perst.

Amr Hesham Abdel Majeed
I found a microsoft page that say pretty much the same... For others: when using xml, linq is recomended.
Asaf
+3  A: 

If by "native" you mean "already residing on the phone" then you don't have a whole lot of options. SQL Compact is already built in to the device - you just can't yet use it from 3rd party applications in the first platform release. There simply isn't a database engine already on the platform that is available to third-party developers.

Your only option for persistent storage out of the box is isolated storage. Microsoft does not ship any database engine usable by third parties that uses that, so your options are to either use a third party solution like Perst (which has been around for a while) or SQLite (I've started the port to my ORM) or to roll your own.

ctacke