Wednesday, November 30, 2011

Why should move to Visual Studio 2010

  • Built-in tools for Windows 7, including multitouch and "ribbon" UI components
  • Rich, new editor with built-in Windows Presentation Foundation (WPF)
  • Multimonitor support
  • New Quick Search, which helps to find relevant results with intellisense support
  • Great support for developing and deploying Microsoft Office 2010, SharePoint 2010, and Windows Azure applications
  • Multicore development support that allow to parallelize applications and a new specialized debugger to help to track the tasks and threads
  • Improvements to the ASP.NET AJAX framework, core JavaScript IntelliSense support, and the inclusion in Visual Studio 2010 of JQuery, the open-source library for DOM interactions
  • Multitargeting/multiframework support
  • Support for developing WPF and Silverlight applications with enhanced drag-and-drop support and data binding
  • Featured support for Team Foundation Server (TFS) 2010 (and previous versions) using Team Explorer
  • Integrated support for test-driven development
For more information :

Monday, November 28, 2011

LINQ - Language Integrated Query

LINQ is a programming model that introduces queries as a first-class concept into any Microsoft .NET language. It allows you to write structured type-safe queries over local object collections and remote data sources. However, complete support for LINQ requires some extensions in the language used. These extensions boost productivity, thereby providing a shorter, meaningful, and expressive syntax to manipulate data.
The LINQ language extensions use the new Standard Query Operators API, which is the query language for any collection that implements IEnumerable<t>. It means that all collections and arrays can be queried using LINQ. The collections classes simply needs to implement IEnumerable<t>, to enable it for LINQ to query the collections. LINQ is a technology that covers many data domains. Some of these domains are included in those “LINQ Flavors” that Microsoft provides as part of the .NET 3.5 Framework, as shown in figure below:

LINQ to Objects
LINQ to Objects has the goal of manipulating collections of objects, which can be related to each other to form a hierarchy or a graph. From a certain point of view, LINQ to Objects is the default implementation used by a LINQ query.
LINQ to ADO.NET
LINQ to ADO.NET includes different LINQ implementations that share the need to manipulate relational data. It includes other technologies that are specific to each particular persistence layer:
  • LINQ to SQL Handles the mapping between custom types in C# and the physical table schema.
  • LINQ to Entities Is in many ways similar to LINQ to SQL. However, instead of using the physical database as a persistence layer, it uses a conceptual Entity Data Model (EDM). The result is an abstraction layer that is independent from the physical data layer.
  • LINQ to DataSet Makes it possible to query a DataSet using LINQ.
LINQ to XML
LINQ to XML offers a slightly different syntax that operates on XML data, allowing query and data manipulation. It provides the in-memory document modification capabilities of the Document Object Model and supports LINQ queries.

Tuesday, November 15, 2011

SQL Server : Covering Index

Covering Index term is used to describe a certain technique that is used to improve performance. It does not mean a separate kind of index having a different internal structure.
      A covering index is a form of a composite index, includes all of the columns referenced in the SELECT, JOIN and WHERE clauses of a query. Because of this, the index contains the data you are looking for and SQL Server doesn’t have to look up the actual data in the table, reducing logical and/or physical I/O, and boosting performance.

On the other hand, if the covering index gets too big (has too many columns), this could actually increase I/O and degrade performance. Generally, when creating covering indexes, follow these guidelines:
  • If the query or queries you run using the covering index are seldom run, then the overhead of the covering index may outweigh the benefits it provides.
  • The covering index should not add significantly to the size of the key. If it does, then it its use may outweigh the benefits it provides.
  • The covering index must include all columns found in the SELECT list, the JOIN clause, and the WHERE clause.
To determine if a covering index could help a query’s performance is to create a graphical query execution plan in Query Analyzer or Management Studio and check for any Bookmark Lookups (RID or Key) being performed. Essentially, a Bookmark Lookup is indicate that the Query Processor had to look up the row columns it needs from a table or a clustered index, instead of being able to read it directly from a non-clustered index. Bookmark Lookups can reduce query performance because they produce extra disk I/O to retrieve the column data.One way to avoid a Bookmark Lookup is to create a covering index. This way, all the columns from the query are available directly from the non-clustered index, which means that Bookmark Lookups are unnecessary, which reduces disk I/O and helps to boost performance.

Example: (specifying the index explicitly in the query, forced SQL Server to use the non-clustered AK_Employee_NationalIDNumber index)
Query 2 is a covered query, a query where all the columns in the query's result set are pulled from non-clustered indexes.