Intersoft WebGrid Documentation
Advanced LINQ to SQL Support
See Also Send comments on this topic.
Intersoft WebGrid > WebGrid Features Overview > Displaying Data > Server-side Binding > Codeless Data Binding > Advanced LINQ to SQL Support

Glossary Item Box

This section discusses the new technology introduced in Microsoft.NET Framework 3.5 to resolve many data-related and performance issues in ASP.NET web development. One of the most common issues in web development is the performance issue when data binding to a large datasource such as a table with several hundred thousands or millions of records.

This section will demystify the real technologies and behind-the-scene techniques to resolve the performance issue when binding to large datasource.

This topic contains the following sections:

Introduction to LINQ to SQL

One of the common techniques to address large datasource retrieval is by delegating the retrieval and paging operation at database (backend) level. However, some of the operations require advanced knowledge of T-SQL. Furthermore, developers are required to write many codes since the operations are difficult to be generalized (reused) due to complex scenarios. This has caused a great deal of frustrating performance bottlenecks as the database size is growing significantly.

LINQ to SQL is Microsoft's answer to this serious bottlenecks and problems. LINQ stands for Language Integrated Query, and is a subset of Microsoft .NET Framework 3.5. With LINQ, you can write SQL-like query in .NET managed languages such as C# or VB.NET. The LINQ to SQL means that your C# query will be automatically translated to Transact SQL behind the scene.

The real power of LINQ to SQL lays on its ability in generating T-SQL query that is compatible with SQL Server 2000, SQL Server 2005, SQL Server 2008 and SQL Express editions. LINQ to SQL is capable to generate T-SQL query that involves several operations in one execution, such as: sorting, grouping, aggregate computation, as well as paging.

Let's see how LINQ to SQL perfectly resolves performance bottlenecks by returning only the records that requested by the databound control.


As described in the above illustration, the LINQ to SQL performs the work necessary to translate the view requested by the databound control into T-SQL compatible query. This is a great time saving feature, as developers no longer have to write a lot of codes.

It's undoubted that "LINQ to SQL" is powerful enough to overcome performance issues and resolve complex business scenarios. The real question now is when and where to apply this new technology, and how easy to consume it.

In more realistic questions, are your databound controls "LINQ to SQL" enabled yet? Have your data presentation component supported "LINQ to SQL"

Creating LINQ to SQL Classes

To get started with LINQ to SQL, you need to configure the LINQ to SQL classes. First, create a new Web application project (or a new Website), and add Northwind.mdf to your App_Data folder. Next, add LINQ to SQL Classes and name it Northwind.dbml such as shown below.
 
Next, add LINQ to SQL Classes and name it Northwind.dbml such as shown below.
 
Finally,open Server Explorer, and drag the desired SQL tables into the designer surface of the newly created Northwind.dbml such as shown below:
 
Save Northwind.dbml, and you're good to go.  

LinqDataSource control for ASP.NET Web development

LinqDataSource is a new datasource control that comes along with ASP.NET 3.5, which wraps most of the LINQ to SQL functionality into one simple, easy-to-use datasource control.

LinqDataSource supports some basic LINQ to SQL features such as:

The only lacking feature in LinqDataSource is the aggregate computation predicate, which is not currently supported in either Select property.

Automating Intersoft Databound Controls

Now we have learnt the benefits of LINQ to SQL, and how to consume it using LINQ query language. In this section, we'll look how Intersoft is taking advantage of this powerful technology in their databound controls.

The latest version of Intersoft's WebUI Suite (2008 R2 Build 207+) has been significantly improved to support LINQ to SQL. The result is obvious - striking fast data retrieval operation and manipulation.

Intersoft's flagship databound controls - WebGrid.NET Enterprise™ and WebCombo.NET™ - sets a new record in performance benchmark, outpacing competing products that were using proprietary, slower and unproven mechanism.

WebGrid with LinqDataSource

The latest WebGrid version has implemented full support for LINQ to SQL technology via LinqDataSource control. With a simple LinqDataSource control in your page, WebGrid will be able to perform the following operations automatically - without the needs to write a single line of code:

Introducing ISLinqDataSource

In order to provide more advanced functionality that doesn't exist in standard LinqDataSource control, we have developed a new datasource control that derives from LinqDataSource. We're proud to introduce ISLinqDataSource, a free download for every .NET developer who wants to build blazing fast web application.

The ISLinqDataSource is now included in the WebUI Studio installation. You can find the component in the Visual Studio toolbox, or in the Add References dialog box.

When WebGrid is bound to ISLinqDataSource, the following features will be automatically processed by using LINQ to SQL for best performance:

 

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.