Showing posts with label DotNet. Show all posts
Showing posts with label DotNet. Show all posts

Saturday, January 7, 2012

What's New in the .NET Framework 4.5 Developer Preview

This topic contains information about key features and improvements in the .NET Framework 4.5 Developer Preview. This topic does not provide comprehensive information and is subject to change.

New features and improvements are described as per bellow.

.NET for Metro style apps

Metro style apps are designed for specific form factors and leverage the power of the Windows operating system. A subset of the .NET Framework is available for building Metro style apps for Windows using C# or Visual Basic. This subset is called .NET APIs for Metro style apps. For more information about this subset.

Core New Features and Improvements

The following features and improvements were added to the common language runtime and to .NET Framework classes:
  • Ability to limit how long the regular expression engine will attempt to resolve a regular expression before it times out.
  • Ability to define the culture for an application domain.
  • Console support for Unicode (UTF-16) encoding.
  • Support for versioning of cultural string ordering and comparison data.
  • Better performance when retrieving resources.
  • Zip compression improvements to reduce the size of a compressed file.
  • Ability to customize a reflection context to override default reflection behavior through the CustomReflectionContext class.

Friday, November 11, 2011

What is new in Dot .Net 4.5 Framework Poster

Jouni Heikniemi, CEO and consultant in a four-person consultancy had create nice poster for new features of dot .net framework 4.5.

What's new in Dot .Net Framework

Saturday, July 16, 2011

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;

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();
        }

Sunday, June 26, 2011

Extension method for IComparable

.net

Extension method for IComparable

C# 3.0 gives great feature of extension method. I am also very much interested for Extension method.  Today, My friend Divyang posts very useful topic "Extension Meathod for IComparable".  I would like to share you something interesting way to use that extension method. This time it's extending IComparable. The API signature for IComparable<T> has been around since the birth of  C language . If the left is less than the right, return something less than 0, if left is greater than right, return something greater than 0, and if they are equivalent, return 0. Well, its readability leaves a bit to be desired.
So Here we have set of extension methods for any type T that implements IComparable:

GUIDs (Globally Unique Identifiers) in .NET

.net

What is GUID ?

A GUID is a 128-bit integer that can be used to uniquely identify something. You may store as primary key in your database. A common approach is to create a auto incrementing integer, another way would be to create a GUID for your field. 
GUIDs can be generated in a number of ways; most often a hash of several things that might be unique at any given point in time like the IP address plus the clock date/time etc are used to generate Unique Ids. Each system may have slightly different algorithm to generate the Unique Id.

Friday, June 24, 2011

Microsoft Free Books For SharePoint 2010


Microsoft SharePoint 2010

I found useful books and wallpaper for SharePoint 2010. 
They are as bellow : 

Windows Phone 7 Development

Windows Phone 7 Development.

Introduction

For programmes, Windows Phone 7 is also exciting, for it supports two popular and modern
Programming platforms: Silverlight and XNA.

Silverlight

A spinoff of the client-based Windows Presentation Foundation (WPF) has already given Web programmers unprecedented power to develop sophisticated user interfaces with a mix of traditional controls, high-quality text, vector graphics, media, animation, and data binding that run on multiple platforms and browsers. Windows Phone 7 extends Silverlight to mobile devices.

Generally you’ll choose Silverlight for writing programs you might classify as applications or utilities. These programs are built from a combination of markup and code. The markup is the Extensible Application Markup Language, or XAML and pronounced “zammel”. The XAML mostly defines a layout of user-interface controls and panels. Code-behind files can also perform some initialization and logic, but are generally relegated to handling events from the controls. Silverlight is great for bringing to the Windows Phone the style of Rich
Internet Applications (RIA), including media and the Web. Silverlight for Windows Phone is a version of Silverlight 3 excluding some features not appropriate for the phone, but compensating with some enhancements.

Thursday, June 23, 2011

Techdays 2011 : Expression Blend for Silverlight Developers

Every year Microsoft conducts Techdays specially for developer community. I found useful video of Techdays which was conducted at UK on "Expression Blend for Silverlight Developers".
The session is split into:
  • Workflow
  • Quick fire tips on Blend
  • Building an app

Tips and Tricks : Visual Studio 2010

Visual Studio 2010

I found good post from my friend divyang blog http://divyang4481.blogspot.com. I like to share with you. It may be increase productivity you.

Tip #1 – You don’t need to select a line to copy or delete it

I always cringe whenever I see someone select an entire line of code in the Visual Studio code editor before copying the line or deleting the line (see Figure 1). You don’t need to do this.
Figure 1
image
f you want to copy a line of code then you can simply press CTRL-c to copy the line and press CTRL-v to paste the line. If you want to delete a line, don’t select it first, just press CTRL-x. You’ll be surprised how much time this one tip will save you.

Tuesday, June 21, 2011

OOPs Concept

Object Oriented Programing is common practice in modern software development. So any beginner developer  must know what it is and should be able to explain certain terms which  is  used in .NET a object oriented programming  platform .  
  • Classes
  • Properties
  • Methods
  • Fields
  • Members
  • Enums
  • Casting
  • Structures
  • Abstraction
  • Encapsulation
  • Interfaces
  • Static classes
  • Constructors
  • Method overloading
  • Inheritance
  • Overriding methods
  • Virtual methods
  • Abstract classes
  • Polymorphism
  • Delegates
  • Events
  • Assemblies
  • Namespaces



Read More.....

Monday, June 20, 2011

Server Side Pagination Query

The paging of a large database resultset in Web applications is a well known problem. In short, you don't want all the results from your query to be displayed on a single Web page, so some sort of paged display is more appropriate. While it was not an easy task in the old ASP, the DataGrid control in the ASP.NET simplifies this to a few lines of code. So, the paging is easy in ASP.NET, but the default behavior of the DataGrid is that all resulting records from your query will be fetched from SQL server to the ASP.NET application. If your query returns a million records this will cause some serious performance issues (if you need convincing, try executing such a query in your web application and see the memory consumption of the aspnet_wp.exe in the task manager). That's why a custom paging solution is required where desired behavior is to fetch only the rows from the current page. 

Here I provide some query which provide solution for custom pagination. It helps to improve your search result for your filter data.
Code

Sunday, June 19, 2011

Divyang Panchasara: move ViewState to bottom of Page in ASP.NET

Divyang Panchasara: move ViewState to bottom of Page in ASP.NET: "on last Saturday, in Community tech days Tejash Shah has discussed about viewstate's prons and crons. in his wonderful session and also..."

Saturday, June 18, 2011

As Operator in C#

The as operator is used to perform certain types of conversions between compatible reference types. "As" Operator is also known as a safe cast. What is does is it attempts to cast from one type to another and if the cast fails it returns null instead of throwing an InvalidCastException.
As-casting is equivalent to the following expression except that expression is evaluated only one time.
expression is type ? (type)expression : (type)null