Posts

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/dow...

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...

End of 2011 and Beginning of 2012

The memories of the last new year 2011 is so fresh in my mind. It just shows how quick the year passed by. There has been always high's and low's in a year. On the professional front i did get a promotion. I did learn new stuff's on the technology front, but not to my expectation. The past year i have been little active on the social media (Twitter, Facebook). On the blog front, i could only manage to make 68 posts. On the personal front i did not take any vacations, that looks bad. On the Spiritual front, i did attend a couple of fasting prayers, sunday services and prayer meetings. Now the past is past, we can only look for a better tommorrow. Hope this year, will try to achieve things i could not in the last year. I am not planning to make any resolutions. I believe the guarding angels will be with me this year and praying to god to help me all my works. Wishing a Blessed and Prosperous Happy New Year 2012 to all my colleagues, readers, family and friends.

“Unable to retrieve the metadata for …” Error while using ASP.NET MVC 3

While adding a controller in ASP.NET MVC 3 application, you might get a error “Unable to retrieve the metadata for …”. This error is due to the incorrect connection string name or the connection string in the web.config. I had encountered the same error and the issue was that the name of my DBContext was different from that of the web.config connection string name. When I made it same it was able to create the controller.

jQuery Mobile

jQuery Mobile 1.0 is released. This is a HTML5 based UI system for all the major mobile device platforms. To  know more about check  http://jquerymobile.com/  .

Node.js on windows

In order to install Node.js and build application on windows follow the steps mentioned below 1. First you can download the WebMatrix from http://www.microsoft.com/web/gallery/install.aspx?appid=webmatrix , if you need it. 2. Download the node.js for windows from http://nodejs.org/ 3. Install the iisnode for the web server a. iisnode for iis7 express - http://go.microsoft.com/?linkid=9784329 b. iisnode for iis7 x86 - http://go.microsoft.com/?linkid=9784330 c. iisnode for iis7 x64 - http://go.microsoft.com/?linkid=9784331 , you may need to install the C++ 2010 redistributable for x64 from http://www.microsoft.com/download/en/details.aspx?id=14632 4. Steve's node.js templates can be downloaded from  https://github.com/SteveSanderson/Node.js-Site-Templates-for-WebMatrix/downloads Now open WebMatrix and choose sites from template. Then choose a Node.js template and run the application. There you go, it should work.

Learn Javascript Courses

To learn Javascript courses, try Codecademy at  http://www.codecademy.com/  . This is a nice site to learn javascript.

Nice Article on HTML5

Read this nice article titled "Better Web Forms with HTML5 Forms" at  http://msdn.microsoft.com/en-us/magazine/hh547102.aspx

FireFox 8 to be launched on Nov 8

FireFox 8 will be launched on Nov 8. Firefox 8 Launches In Two Days, But Here's How To Get It NOW, Read at http://www.businessinsider.com/download-firefox-8-2011-11 "Firefox 8, which comes just six weeks after the launch of Firefox 7, includes some slick new features. There's Twitter embedded in the search bar, better add-on management, much improved tabs, support for HTML 5 context menus, and a lot more."

MSDN Magazine November Edition

The MSDN Magazine November edition is available. Check out here http://msdn.microsoft.com/en-us/magazine/hh547094.aspx

Nice article - "The Internet of Things and the cloud"

This is a nice article related to internet and cloud , its titled "The Internet of Things and the cloud" http://gigaom.com/cloud/alex-salkever-on-the-internet-of-things/

MSDN Magazine October Edition

The MSDN Magazine October edition is available. Check out here http://msdn.microsoft.com/en-us/magazine/hh463583.aspx

ASP.NET vNext Series by Scott Gu

Check out the articles on the ASP.NET vNext Series by Scott Gu at  http://weblogs.asp.net/scottgu/archive/2011/08/31/asp-net-vnext-series.aspx

Types of Cursors in SQL SERVER

The types of Cursors are as mentioned below Static The static cursors are those where the data on retrieval is not modified and remains as before it entered the cursor since its stored in the tempdb. This is also know as read-only cursors. Forward The forward only cursors can move forward in the result set. Dynamic The dynamic cursors identify all changes to data inside of the cursor or from outside by other users. If a particular data in a row was changed after that dataset was assigned to cursor, when that rows comes up we do see the modified data. Keyset-Driven The keyset cursors is such that when the cursor is open it will see the modifications happened for any row outside by other user before assigned to the cursor but will not see new records added.

8 years of Blogging

I was just thinking that it has been 8 years since i started blogging, time passes so fast. Just wanted to put down the number of blog post i have written in all these years 2003 - 2004 => 8 2004 - 2005 => 0 2005 - 2006 => 0 2006 - 2007 => 31 2007 - 2008 => 28 2008 - 2009 => 55 2009 - 2010 => 26 2010 - 2011 => 61 From above it looked like in the initial days i was not blogging much. For 2 years i had another blog which is no more available due to which this blog had no entries. Also due to hectic work schedules, i was not able to blog as well. I feel this year has been good and one of the highest number blog posts. Of late i am more on twitter ( @shaju  ) as well. I am hope in the coming days i will try to keep the same momentum, to increase this count as well. I wish many more readers come to my blog in the coming days. 

Cursors in SQL SERVER

We may need to do some operation each record wise in the record set returned. This is reason for cursors. The Syntax is as follows DECLARE cursor_name [ INSENSITIVE ] [ SCROLL ] CURSOR FOR select_statement [ FOR { READ ONLY | UPDATE [ OF column_name [ ,...n ] ] } ] [;] The below example shows that we need to print the employee name and employee id in a specific manner as Robert Smith (1000) DECLARE @ EmployeeID int DECLARE @Name varchar (100) DECLARE cursor_name CURSOR FOR SELECT EmployeeID , FirstName + ' ' + LastName FROM Employee OPEN cursor_name FETCH NEXT FROM cursor_name INTO @ EmployeeID , @Name WHILE @@FETCH_STATUS = 0 BEGIN   PRINT @Name + '(' + Convert( varchar (10), @ EmployeeID ) + ')'   FETCH NEXT FROM cursor_name   INTO @ EmployeeID , @Name END CLOSE cursor_name       DEALLOCATE cursor_name

Partition Information in SQL SERVER

Partition Function Information The Partition Function Information is obtained from the sys.partition_functions table as shown below SELECT * FROM SYS.PARTITION_FUNCTIONS Partition Range Information The Partition Range information is obtained from the sys.partition_range_values as shown below SELECT * FROM SYS.PARTITION_RANGE_VALUES Partition Scheme Information The Partition Scheme information is obtained from the sys.partition_scheme as shown below SELECT * FROM SYS.PARTITION_SCHEME Partitions Information The Partition information can be obtained from the sys.partitions table as shown below . SELECT * FROM SYS.PARTITIONS

Dropping of Partition in SQL SERVER

Drop a Partition Function To drop a partition function it should not have any partition scheme associated with it. The Syntax is as follows   DROP PARTITION FUNCTION < Partition Function Name  > The below example shows how to drop a partition function   DROP PARTITION FUNCTION EmployeePartitionLeft Drop a Partition Scheme To drop a partition scheme it should not have any table associated with it . The Syntax is as follows   DROP PARTITION SCHEME < Partition Scheme Name > The below example shows how to drop a partition scheme   DROP PARTITION SCHEME EmployeePartitionScheme

ASP.NET MVC 4 Developer Preview Released

I just happened to see this on Phil Haack's blog that the ASP.NET MVC 4 Developer Preview Released. Check out for more at   http://haacked.com/archive/2011/09/14/asp-net-mvc-4-developer-preview-released.aspx