Sunday, June 22, 2014

Regular expression to validate multiple Email IDs separated by comma

Today I am giving you a simple regular expression to validate multiple email IDs separated by comma. This is one of the very common expression we require during the application development.
Regular expression you may use for this purpose is,
^\s*((\s*[a-zA-Z0-9\._%-]+@[a-zA-Z0-9\.-]+\.[a-zA-Z]{2,4}\s*[,]{1}\s*){1,100}?)?([a-zA-Z0-9\._%-]+@[a-zA-Z0-9\.-]+\.[a-zA-Z]{2,4})\s*$
Below is the complete code for a sample asp.net page to validate multiple Email IDs

Monday, June 16, 2014

How to install ASP.NET MVC 5 in Visual Studio 2013 using NuGet Package Manager

Today I am sharing you a simple steps to install ASP.NET MVC 5 in your visual Studio 2013. I hope you are aware all templates and add on to visual Studio can be easily installed using NuGet package manager. If you are new to NuGet package manager then I would suggest you to read my earlier article “” 
Once you install the NuGet package manager then we will open the console to install the ASP.NET MVC 5 template.

Wednesday, June 4, 2014

How to get Month wise summary in MS SQL

One of the common query I used to see in Microsoft forum is “How to get month and year from a datetime column in SQL Server”, Since I saw this question today again I thought I will write small article about this.
Mostly we require this query when we generate reports. Month wise report or Month and Year wise report definitely require such kind of query.
We will directly jump on to the solution and the query.
First we will create a table with datetime field and two numeric columns to get the sum based on the month and year.

Sunday, June 1, 2014

How to re-create designer.cs in Visual Studio 2013

Some time you may have to re-create .designer.cs file of your .aspx page. There can be many reason for re-generating this file. You must be surprised to know that there is no direct option to re-generate .designer.cs file. All you have to do is workaround, but it generates the file without any error and application doesn’t throw any error.
Let’s see the step by step process by deleting the designer .cs first.
image

Tuesday, May 20, 2014

Not able to access classes in the App_Code folder in Visual Studio 2013

You might be wondering why my classes inside the App_Code folder is not accessible when you are trying to add reference in the code behind page. This is one of the common issue and the solution is very simple. Here in this article I will be helping you to resolve this issue.
To resolve this issue what you have to do is right click on the class file and then select the properties.
image

Wednesday, April 9, 2014

Synchronize local MS SQL database to SQL Azure

In this article I will be taking you through the steps to synchronize your local MS SQL Database to SQL Azure. This is one of the regular requirement you may find in your application development when you are using Windows Azure. Synchronizing the local database will allow you to export all the data from your local database to SQL Azure in few seconds or in few minutes.
SQL Azure allows you to configure this synchronization automatically and will allow you to set the frequency of data synchronization as well. 
Ok, as usual we will go through the complete procedure step by step.
First we will create a database in our local database system and insert few data in the table.
image

Tuesday, April 8, 2014

Deploy ASP.NET web application in cloud with SQL Azure Connectivity

Today I am taking you to the complete deployment of an ASP.NET web application with database connectivity in Microsoft Azure. Since database is in cloud we have to do some configuration changes while doing the deployment. In this article we will do the sample development in local system and we will do only the deployment in Microsoft Azure. As you are aware once deploy the application in Microsoft Azure by using SQL Azure as database everything will be online and people will be able to access the application over the net.
Lets go through the complete procedure you have to follow to do the web application deployment with SQL Azure.

Thursday, April 3, 2014

Ajax MutuallyExclusiveCheckBoxExtender in ASP.NET

Earlier when we didn’t Ajax we were using JavScript to make Mutually exclusive Check boxes. Otherwise you have to use radio buttons. So make it easier for the .NET developers Microsoft introduced MutuallyExclusiveCheckBoxExtender in AJAX.
It required hardly few lines of codes and it is very easy and simple to understand. In this article I am taking you through this interesting control which you can use in your application whenever you require Mutually Exclusive CheckBox.
First we will design a sample webpage by adding few check boxes. Your sample page design may look like below,
image

Saturday, March 29, 2014

Load balancing using Windows Azure Virtual Machine

This is one of the common query everyone started using Windows Azure will have. How we can make a load balancer in case if we have to host a site which will be getting huge traffic. In windows Azure load balancing configuration is very simple. In this article we will go through how to configure load balancing in windows azure and also we will see how to deploy ASP.NET web applications in Windows Azure load balancing server.
Let’s go through step by step procedure.

Tuesday, March 25, 2014

How to Deploy ASP.NET web application in Windows Azure Virtual Machine

Are you searching for the steps to deploy ASP.NET web application in windows Azure Virtual Machine? Yes, in this article I am going to give you the step by step procedure to deploy the web application in cloud.
If you are not sure how to create Virtual Machine in Windows Azure you may read my article How to create Virtual Machine in Windows Azure
In this article I am explaining the steps you have to follow after creating the Virtual machine.
As usual first you have to login to the Virtual Machine by login to your Windows Azure account. You may open your Windows Azure account by opening Windows Azure Login Page

Tuesday, March 18, 2014

How to create Virtual Machine in Windows Azure

Do you know, with few clicks you will be able to create Virtual Machine in Windows Azure. In this article I am going to create Virtual Machine in Windows Azure. Let’s see how easy to create virtual machine in windows Azure.
Let’s go through step by step procedure, first we will login to Windows Azure by opening Windows Azure Login Page
1VM

Monday, March 17, 2014

How to Create Database in SQL Azure

Are you looking for a way to connect windows Azure and create database? If you wanted to know how to create database table in Microsoft cloud then ready this article. Here I am going to explain how to create database, how to create table and then finally how to query the table from SQL Azure.
First we will connect to the Windows Azure. You should have a windows Azure account in order to login to Azure site. Here is the URL to login to Windows Azure.
Once you login to your account you will find below page.
1Azure Config Page

Tuesday, March 11, 2014

REBOOT Bangalore - CloudCamp

Great opportunity to all of you to have a free session from MVPs and Microsoft Employees.
Reboot is the first ever full day community driven multi city, multi-track event happening in Namma Bengaluru.
Reboot will witness great line up of speakers from different parts of India who are great community leaders, helping grow and shape the technical communities in their respective cities. Many of them are the Microsoft Most Valuable Professionals or Microsoft Employees.
Below are sessions planned for you with free meal @ ITC HOTEL WINDSOR SHERATON & TOWERS (Windsor Manor)
Join us with our MVPs as they discuss how you can build and scale in the cloud.

Thursday, March 6, 2014

How to write text on an Image using C#

Are you looking for a C# code to write text on an image? In this article I am trying to explain how we can write text on an image?
Using this code you can write any text in an image at any place, using any color and format of the text.
First we will look at the form design. The form looks like below,
textonimage

Wednesday, February 26, 2014

How to find Operating System version using SQL query

There are some cases you wanted to check the Operating system installed on your SQL server. You may not have remote login access to the server where SQL server is installed in that case it will be difficult to know what is the operating system installed on your server where SQL database is installed.

In this article I am going to explain you the simple query which you can run in your SQL server Query analyzer and it will show you the Operating System version installed on your database server.

SQL Server by default provides you an inbuilt table with all the details of the operating system installed on your database server. sys.dm_os_windows_info is the table you may query in this regard.

Your final query will be,

SELECT windows_release, windows_service_pack_level, windows_sku, os_language_version
FROM sys.dm_os_windows_info

And the output of the above query will be,

windows_release windows_service_pack_level windows_sku os_language_version
6.1 Service Pack 1 10 1033

In the above result you can see that windows release is 6.1 means Windows Server 2008 R2 in my case. It can be Windows 7 if your database is not installed on the server.

You can find all the operating system version number in below chart.

Operating system Version number
Windows 8.1 6.3
Windows Server 2012 R2 6.3
Windows 8 6.2
Windows Server 2012 6.2
Windows 7 6.1
Windows Server 2008 R2 6.1
Windows Server 2008 6
Windows Vista 6
Windows Server 2003 R2 5.2
Windows Server 2003 5.2
Windows XP 64-Bit Edition 5.2
Windows XP 5.1
Windows 2000 5

image001