Saturday, July 16, 2011

Juneau : Microsoft SQL Server Developer Tools

Microsoft announce new SQL Server tools, code named "Janeau" CTP 3 on 13th June 2011. For install "Janeau" is required Visual Studio 2010 SP 1. The operating system is required vista sp2 or above, Windows 7, Sql Server R2 SP 2. From bellow link you can download "Janeau" from microsoft.

Janeau Download Link

Microsoft provide nice video series for get starting with "Janeau". So here I share one of them video regarding "Janeau" integrate with visual studio via entity framework.




More Video refer bellow link

C# 2.0 - Null Coalesce Operator

Null coalesce operator (??) was a very nice feature of C# 2.0. Null coalesce converts nullable type to non-nullable type. The ?? operator uses to define a default value for nullable type. For that in previous version of C#, we have to right like as bellow.

long lngMarks;
long lngAvg = (lngMarks == null ? 0 : lngMarks) / 6;

In above case, we use ternary operator(?) for check, value is null or not. Now it is more easy with Null Coalesce operator (??). We can use the Null - Coalesce Operator (??) as a shortcut for that expression, as shown here:

long lngMarks ;
long lngAvg = (lngMarks??0) /6;


Null coalesce operator(??) is a very small but very useful feature of C# 2.0.

Friday, July 15, 2011

Validation Class For String

Extension method is introduced by Microsoft in .Net 3.5. With help of extension method, developer can extend any class without change in original source code. Extension methods are static methods that can appear to be part of a class without actually being in the source code for the class. So extension method is one of the richest feature of .net 3.5.

Here I create class for string validation which extends string class. With help of bellow class we can validate some regular string validation like email, password , numeric etc. It provide facility to validate your own custom regular expression.

Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

Design icon for windows Mobile with expression design

Hello friends,
On channel 9, I found nice video from John Papa, which is describe how to create icon ,splash screen with Microsoft Expression Designer. With help of this video, developer can easily create there own icon and splash screen for custom application. It is really very nice video. It helps to developer stencil icon and splash screen very fast and effective way.


Tuesday, July 12, 2011

C# : Tupel


Array can combine objects which have same type, but some time we need to combine objects which have different types. For that in Framework 4.0, Microsoft introduces new feature Tupel. Tuple provides facility to combine of different type of object in one object. Tupel is derived from programing language such as  F# or like Haskell in Python.  With .NET 4 , Tupel is available for all .NET languages.

Example
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            //get age from passed birthdate
           Tuple<int,int,int> age = calculateAge(new DateTime(1982,4,4));
            //Tuple value can access with age.Item1.........
           Console.WriteLine("Age {0} years, {1} months, {2} days", age.Item1, age.Item2, age.Item3);
           Console.ReadKey();
        }