In this tutorial we will cover creating a LinqDataSource control and applying it to a pre-existing database table.
Configuring a LinqDataSource control
Download the LinqDataSource control Project Source
In this tutorial we will cover creating a LinqDataSource control and applying it to a pre-existing database table. If you do not already have a table with data created please see the adding data to a database table tutorial to learn how to create this file, or download the adding data to a database table source file from the last tutorial. The LinqDataSource control is used to manage the data on a web page.
We are using Server Intellect and have found that by far, they are the most friendly, responsive, and knowledgeable support team we've ever dealt with!
1. Open the website project in visual studio and if an App_Code folder has not been created yet, right click the name of the project and select Add ASP.NET Folder.
2. Right click on the App_Code folder and select Add New Item.
3. In the Add New Item List, select Linq to SQL Classes and leave the name of the file default (DataClasses.dbml).
4. Click Add.
5. When the Object Relational Designer opens switch to the server explorer and expand the Tables folder.
6. Click on the Customers Table and drag it into the Object Relational Designer window as shown below.

Yes, it is possible to find a good web host. Sometimes it takes a while. After trying several, we went with Server Intellect and have been very happy. They are the most professional, customer service friendly and technically knowledgeable host we've found so far.
7. Select Web Form from the Add New Item menu, leave the name as it is (Default.aspx) and click add.
8. When the page opens, switch to design view.
9. In the Toolbox under the Data menu, click and drag a LinqDataSource control onto the page.
10. There will be a small thumbnail on the upper right hand corner of the control. Click the thumbnail to expand the LinqDataSource Tasks menu as shown below.

11. In the LinqDataSource Tasks menu select Configure Data Source.
12. Make sure the show only box is checked the under the context object menu, then make sure the DataClassesDataContext object is selected (see below) then click Next.

13. In the Configure Data Selection menu make sure the asterisk box is checked (see below) this will select all of the items on the list.

14. Click Finish.
-You now have a functional LinqDataSource control you can use to manage the data on your webpages.
We are using Server Intellect and have found that by far, they are the most friendly, responsive, and knowledgeable support team we've ever dealt with!