Click here to Skip to main content
13,295,616 members (27,023 online)
Click here to Skip to main content
Add your own
alternative version


2 bookmarked
Posted 15 Oct 2012

Calendar of Events in Windows Phone

, 15 Oct 2012
Rate this:
Please Sign up or sign in to vote.
Developing a Windows Phone app step by step


Nowadays, most people always have busy days with a lot of meetings and a lot of work to do, and they must ensure that they don't forget any of them. So, why not help these people by providing an application that helps them manage all their events. As people may need this app anywhere and at anytime, it will be just great if they could get it with them in their pocket! So this app will be a Mobile app. And as we want to learn about the Microsoft's Mobile OS, we will use Windows Phone 7 as a platform.

Installing Tools

To develop applications in Windows Phone 7, you will need to have Visual Studio Express for Windows Phone which you can download from here, or if you have Visual Studio 2010 already installed on your computer, just install the WP7's SDK.

Building the Database

In WP7, you have to use the LINQ technology to manipulate your database. So we will need to add a reference to System.Data.Linq and to add the System.Linq using. We will reference our database by this:

ScheduleDataContext EventsDB = new ScheduleDataContext(@"isostore:/EventsDB.sdf"); 

So now we could manipulate our database as it is an object. To create it, just use the CreateDatabase() method:

if (EventsDB.DatabaseExists() == false)
    catch (Exception exc) { return false;} 

As shown in the following picture, Intellisense provides all given methods with a little description.

It's good to program using the MVVM pattern. The Model here is the Event object. Because I will store it into the database, I have to specify the columns to use and their properties using annotations. The attribute that is started with [Column] will be stored in a column with his name.

    public class Event
        [Column(IsPrimaryKey = true)]
        public int EventID
        [Column(CanBeNull = false)]
        public string EventName
        [Column(CanBeNull = false)]
        public DateTime DateFrom

Then, to add an Event object to the table, just use InsertOnSubmit(Event) and SubmitChanges() methods.


Deleting an Event is also so simple. Consider using DeleteOnSubmit(Event) to delete and SubmitChanges() to save modification.

Here is an image that shows how Intellisense can help you.

Download the Full Project

You can download the full application code from MSDN.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Houssem Dellai
Software Developer
Tunisia Tunisia
Software Engineerwho likes spending my free time developing open source .NET applications.
Mail :
Phone : +216 29 903 563

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.171207.1 | Last Updated 15 Oct 2012
Article Copyright 2012 by Houssem Dellai
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid