OData caching on Windows Phone .. & an eBook!

SilverlightShow (@silverlightshow) is a wonderful resource for daily Silverlight and Windows Phone 7 news, exclusive articles, tutorials, videos and training. I would encourage anybody interested in Silverlight, WPF, Windows Phone & other related technologies to check out the SilverlightShow content @ http://silverlightshow.net.

I guest-blogged my 3rd article for SilverlightShow yesterday:

OData seems to have a lot of promise in simplifying data access across multiple platforms by using fundamental technologies of HTTP and Atom/JSon. Using an OData source for data consumption/updates in your Windows Phone application? In this short article, we take a quick look at a data caching strategy in our Windows Phone applications while using an OData data source. While we talk about a Windows Phone solution in particular, these concepts are perfectly applicable when using OData on other mobile platforms.

Full article with screenshots, code samples & downloadable source code can be found HERE.

Also, SilverlightShow was gracious enough to compile my articles in a short eBook, with the overall theme of OData usage in Windows Phone & Azure augmentation of mobile applications. Details HERE.

Cheers SilverlightShow!

Adios

Advertisement

6 thoughts on “OData caching on Windows Phone .. & an eBook!

    • Hi misiraul,

      Thank you for your comments!

      Yes, you’re right about the first point. At the time of writing Ch 1, SQL Azure Labs was in CTP and we could configure a SQL Azure DB to have an automatic OData service. This functionality is rumored to return in February. In the meantime, it should be easy to add an OData service to your DB & host it in Azure.

      About Ch 2, you can add an Update operation without much difficulty. Please take a look at the ‘AddPatient’ method .. you can do updates similarly: create context, write Linq to select your record & then call ‘context.UpdateObject(..)’.

      Makes sense? Please feel free to ping me if you need help with either of these.

      Again, thanks for comments!

  1. I managed to make the relationship in SQL Management Studio with a constraint (MS changed today the SQL Azure managemt tool – SL5 )
    *about the update :
    IService1.cs :
    [OperationContract]
    string UpdProdus(Produs produs); // my table name is Produs
    Service1.svc.cs
    public string UpdProdus(Produs produs)
    {
    try
    {
    var context = new ContorEntities();
    context.Attach(produs);
    context.ObjectStateManager.ChangeObjectState(produs, System.Data.EntityState.Modified);
    context.SaveChanges();
    return “Success!”;
    }
    catch (Exception e) { return e.Message; }
    }
    Is this ok by here?

    ProductList.xaml
    If I want to update a record I should add a TextBox in the Listbox
    ProductList.xaml.cs ?

    • Sounds right Misi!

      It is up to you how you want add/edits to work. You could put textboxes inside a listbox, or create a separate XAML page that adds/edits data

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s