|
C# 2008 Programmer's ReferenceWhen you save the file, Visual Studio 2008 persists out .NET classes that represent the entities and database relationships that you have just added. For each LINQ to SQL designer file you add to your solution, a custom DataContext class is generated. It is the main object that you use to manipulate the table. In this example, the DataContext class is named DataClassesDataContext. Be sure to save DataClasses.dbml before proceeding. Data Binding Using the GridView Control To display the records from a table, you can use the GridView control, which displays the values of a data source in a table where each column represents a field and each row represents a record. Drag the GridView control from the Toolbox and drop it onto the design surface of Default.aspx. In the SmartTag of the GridView control, select <New data source…> in the Choose Data Source dropdown list (see Figure 17-6). Figure 17-6 In the Data Source Configuration Wizard (see Figure 17-7), select LINQ and click OK. Use the default name of LinqDataSource1. Click OK ...» |
Код для вставки книги в блог HTML
phpBB
текст
|
|