LINQ to SQL (Part 5 - Binding UI using the ASP:LinqDataSource Control)
page 2 of 8
by Scott Guthrie
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 37602/ 145

Sample Application We'll be Building

The simple data editing web application I'll walkthrough building in this tutorial is a basic data entry/manipulation front-end for products within a database:

Figure 1

The application will support the following end-user features:

Allow users to filter the products by category

Allow users to sort the product listing by clicking on a column header (Name, Price, Units In Stock, etc)

Allow users to skip/page over multiple product listings (10 products per page)

Allow users to edit and update any of the product details in-line on the page

Allow users to delete products from the list

The web application will be implemented with a clean object-oriented data model built using the LINQ to SQL ORM.

All of the business rules and business validation logic will be implemented in our data model tier - and not within the UI tier or in any of the UI pages.  This will ensure that: 1) a consistent set of business rules are used everywhere within the application, 2) we write less code and don't repeat ourselves, and 3) we can easily modify/adapt our business rules at a later date and not have to update them in dozens of different places across our application.

We will also take advantage of the built-in paging/sorting support within LINQ to SQL to ensure that features like the product listing paging/sorting are performed not in the middle-tier, but rather in the database (meaning only 10 products are retrieved from the database at any given time - we are not retrieving thousands of rows and doing the sorting/paging within the web-server). 


View Entire Article

User Comments

Title: Add new   
Name: Aditya
Date: 2010-05-29 1:38:06 AM
Comment:
Hi boss this is really nice.
Title: Add column on selecting   
Name: Peter
Date: 2010-04-18 7:19:36 PM
Comment:
Can you actually add column on the linq data source while selecting?
Title: Nice   
Name: vijay
Date: 2009-03-02 5:52:16 AM
Comment:
Nice detailed article.
Title: Adding new item   
Name: Evans
Date: 2009-02-25 1:28:39 PM
Comment:
Can we add new item directly with linq?
Title: Cleaning Up SupplierID and CategoryID   
Name: brian
Date: 2008-10-12 4:03:05 PM
Comment:
If the associated category or supplier no longer exists, you will get a NullReferenceException if you attempt to sort on the associated column in the GridView. Is there some way to handle this?

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-10-10 5:00:42 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search