Skip to main content


Showing posts from September, 2011

NuGet package with multiple projects

Before some day one of my friend asked me to install NuGet in project another then startup project. At that time I don’t have any idea about it. So I did some R and D on web and found one easiest way to do it. So let’s first create a solution where we have more then one project in single solution. I have created a new solution and create three project in single solution as below.
MyApplication- Main web application project.MyApplication.Business- This project contains all business logic classes of applicationMyApplication.Data- This project contains all data access layers classes of application Its looks like following.

Now I want to add EFCodeFirst NuGet package to MyApplication.Data project as I want to use entity framework code first for database operations. To add new package with in the project. you can select project and then click ‘Manage NuGet Packages’ like following.

Once you click it will show a dialog for NuGet Packages  like following.

I have selected EFCodeFirst and Onc…

BigInteger in C# 4.0

In C# 4.0 Microsoft has added so many features and I love all most all the features. In today’s post we are going to discuss BigInteger Class. During programming some complex systems often we need a very big numbers. For example if we use some of asymmetrical cryptographic feature which require to use large numbers or we can give simple example of factorial where we sometime reached to limit of data type provided by C# compiler. At that time this BigInteger data type can be very handy. You can store 232 to 264 number in this data type. So its very big and you can copy very very big number in that data type.

So let’s take a simple example to write a factorial program. BigInteger data type comes under System.Numerics namespace. So first we have to add reference to our program to System.Numerics assembly like following.

Now we have added the reference to System.Numeric so we are ready for code. Here in code I have just taken a very large number in big integer which is out of range o…

Entity framework and Stored procedure output parameter

One of my friend was having problem in Entity framework and stored procedure output parameter. He was confused how to use output parameter with stored procedures.So I did some search on internet and I found a great way to use output parameter so I thought I should write a blog post for the same. So in this blog post I am going to explain you how we can use output parameter of entity framework.

So let’s start coding for that.For demo, I have create a table called ‘Customer’ which contains just two columns CustomerId and CustomerName. Following is the script for that.

/****** Object: Table [dbo].[Customer] Script Date: 09/09/2011 00:18:33 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Customer]( [CustomerId] [int] NOT NULL, [CustomerName] [nvarchar](50) NOT NULL, CONSTRAINT [PK_Customer] PRIMARY KEY CLUSTERED ( [CustomerId] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_…

Jquery and ASP.NET- Set and Get Value of Server control

Yesterday one of my reader asked me one question that How can I set or get values from Jquery of server side element for example. So I decided to write blog post for this. This blog post is for all this people who are learning Jquery and don’t know how to set or get value for a server like ASP.NET Textbox. I know most of people know about it as Jquery is very popular browser JavaScript framework. I believe jquery as framework because it’s a single file which has lots of functionality.

For this I am going to take one simple example page which contain two textboxes txtName and txtCopyName and button called copyname. On click of that button it will get the value from txtName textbox and set value of another box. So following is HTML for this.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="Experiment.Index" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://w…

ReCaptcha in ASP.NET MVC3

As a web developer we know what is captcha is. It’s way to confirm users as they are human.Following is captcha definition per WikiPedia.
A CAPTCHA (/ˈkæpə/) is a type of challenge-response test used in computing as an attempt to ensure that the response is generated by a person. The process usually involves one computer (a server) asking a user to complete a simple test which the computer is able to generate and grade. Because other computers are assumed to be unable to solve the CAPTCHA, any user entering a correct solution is presumed to be human. Thus, it is sometimes described as a reverse Turing test, because it is administered by a machine and targeted to a human, in contrast to the standard Turing test that is typically administered by a human and targeted to a machine. A common type of CAPTCHA requires the user to type letters or digits from a distorted image that appears on the screen. You can find more details about that on following link.… new domain for personal blog

After more then 4 years of blogging I have decided to migration my personal blog to its own domain There are few reasons why I have migrated my blog to new domain.
Custom domain is your own identity. So you can create your brand.Now all page ranks and All SEO belongs to my custom domain instead of blogger platform.SEO will be more easy then standard custom domain. I want to reach more people and its easy with your custom domainPeople will share bookmarks with my custom domain. So If I migrated my blog to another plate all things will remain same.PageRank was increasing with subdomains very slowly. While with custom it will increase faster.In lots of companies I have seen block blog word with custom domain its will removed. So more people can reach at my blog when they need me. Here is a great link which inspired me a lot for migrating my blog to to

Note: I have not change my feeds address for personal b…