Posts

Showing posts from January, 2012

Isolated Storage Explorer for Windows Phone 7

Image
In the previous blog post we had used the Isolated Storage for storing the data. We wondered how we can see the file or interact with the same. For this we have a tool called “Windows Phone 7 Isolated Storage Explorer”, this is a codeplex project. We can download the same from http://wp7explorer.codeplex.com/ . The features are mentioned in the website. In this article we will focus on how we can get this working along with the windows phone 7 applications. Firstly, in the windows phone application we have to reference the “IsolatedStorageExplorer.dll”. This is available in your “< dir > \Program Files\WP7 Isolated Storage Explorer\Library”.  Then we have to add the below code in the App.xaml file as mentioned below Now we will launch the application and also open the explorer. It will look like as shown below In the above screenshot, we can see the “Contact.txt” the file that was created for our “ContactApp”. We can view the contents of the same

Building a Simple Windows Phone 7 application

Image
In this article, we will build a simple windows phone application. We have seen in the earlier blog post on the installation of windows phone SDK. We will see how to create a simple application which will save the contacts on a windows phone. Let’s begin by choosing the Windows Phone Application project as shown below By default the “MainPage.xaml” file is created, we will modify the application title and page title as in the StackPanel as shown below < StackPanel x : Name ="TitlePanel" Grid.Row ="0" Margin ="12,17,0,28">       < TextBlock x : Name ="ApplicationTitle" Text ="Contact App" Style ="{ StaticResource PhoneTextNormalStyle }"/>       < TextBlock x : Name ="PageTitle" Text ="My Contacts" Margin ="9,-7,0,0" Style ="{ StaticResource PhoneTextTitle1Style }"/> StackPanel > We will add the application icons add, delete

Getting started with Windows Phone Development

If you are planning for development of apps for Windows phone, download the SDK 7.1 which has all tools needed for development from here  http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=27570 Happy Coding...

Features of ASP.NET MVC 4 Developer Preview

The new features of ASP.NET MVC 4 Developer Preview as the release notes mentioned in  http://www.asp.net/whitepapers/mvc4-release-notes  is as follows Enhancements to Default Project Templates Mobile Project Template Display Modes jQuery Mobile, the View Switcher, and Browser Overriding Recipes for Code Generation in Visual Studio Task Support for Asynchronous Controllers Azure SDK Known Issues and Breaking Changes To know more about these features check out at  http://www.asp.net/whitepapers/mvc4-release-notes

SQL to MongoDB Mapping Chart

If you are a SQL guy and want to use Mongo then you can check out this chart which illustrates the SQL to Mongo Mapping. Check this out at  http://www.mongodb.org/display/DOCS/SQL+to+Mongo+Mapping+Chart Hope this Helps. Please do drop a comment.

Displaying Data using ASP.NET MVC and OData Service

Image
I am sure you have read the first article on Building a OData Service . In Continuation, lets use the created OData Service along with a ASP.NET MVC application. In this article we will execute a OData Service query and the returned results will be displayed on the ASP.NET MVC application using JQuery. As you are aware the OData Service in the previous article was created over the Northwind Database. We will use the query to show those products which has a unit price less than 30. The service query will look as mentioned below http://localhost:2240/ODataService.svc/Products?$filter=UnitPrice lt 30 We will add the below mentioned code snippet to display the records returned in the form of list as “Product Name – Unit Price” The above code uses the “getJSON” to get the result in JSON from, and then we loop through to display the same in a list form as shown below Hope this was useful. Please do drop your comments.

Getting Started with Entity Framework 4.1

To get started with Entity Framework 4.1, we need to install the following  http://www.microsoft.com/download/en/details.aspx?id=26825   Please ensure you are already running Visual Studio 2010. The Entity Framework 4.1 has the features of "Code First" and DbContext API.

Building application using ASP.NET MVC and MongoDB

Image
This article talks about building a simple application using ASP.NET MVC and MongoDB. From my earlier blog post, the installation steps for Mongo DB were explained. For building application using MongoDB and .NET, we need the 10gen C# Driver. This can be downloaded from http://github.com/mongodb/mongo-csharp-driver/downloads Let’s began creating a simple ASP.NET MVC 3 application. We will be creating a simple application which will save the contact details and view the same. The contact model is as show below     public class Contact     {         [ Required ]         [ Display (Name = "Contact ID" )]         public int ContactID { get ; set ; }              [ Required ]         [ Display (Name = "Name" )]         public string Name { get ; set ; }         [ Required ]         [ Display (Name = "Contact Number" )]         public string ContactNumber { get ; set ; }         [ Required ]         [ Displa

Installation of MongoDB on a Windows

The installation of MongoDB on a windows system is pretty simple. Step 1: Download the Binaries for Windows from  http://www.mongodb.org/downloads  (32bit or 64bit) Step 2: Unzip the file into a folder in C drive or drive of your choice . Lets name it "mongo" Step 3: Mongo stores the data in a folder "data\db", but this needs to be created manually. Lets create this on the same drive where mongo binaries unzipped files reside as in step 2. Step 4: Open Command Promopt, go the folder path where binaries was unzipped, for eg: C:\mongo\bin. Step 5: Run command "mongod" to run the database server. Step 6: You can open another command prompt with same folder path and run command "mongo", it will be connected. We start saving and querying against the database. Hope this Helps. Please leave your comments.

Building a OData Service

Image
Open Data Protocol is popularly known as OData. The definition from the OData.Org is as mentioned below “ Open Data Protocol (OData)  is a Web protocol for querying and updating data that provides a way to unlock your data and free it from silos that exist in applications today. OData does this by applying and building upon Web technologies such as  HTTP ,  Atom Publishing Protocol  (AtomPub) and  JSON to provide access to information from a variety of applications, services, and stores.” We will see how to build a simple OData Service which can be consumed my applications. To build OData Service, we need to ensure that the WCF Data Service is installed. If not, install the software as mentioned here  http://msdn.microsoft.com/en-us/data/ee712906 . In this article we will use the “Product” and “Category” table in the NorthWind Database. In case you don’t have the NorthWind database, you can download the same from http://www.microsoft.com/download/en/details.aspx?id=2365

Design Patterns -- Abstract Factory Pattern

Image
Abstract Factory Pattern is a type of Creational Pattern . What is Abstract Factory Pattern? Let’s go by Definition in Gang of Four (GOF) “ Provide an interface for creating families of related or dependent objects without specifying their concrete classes “ Let’s look into this pattern for an example where we are products which can be categorized for Basic, Regular, Seasonal etc. We will create an interface for the abstract product as show below     interface IProductFactory     {         Hashtable ProductProperties();     } The next step we will create a concrete product class     class BasicProduct : IProductFactory     {         public Hashtable ProductProperties()         {             Hashtable ht = new Hashtable ();             ht[ "Type" ] = "FMCG" ;             ht[ "Name" ] = "Soap" ;             return ht;         }     }     class SeasonalProduct : IProductFactory