HTML and CSS Reference
In-Depth Information
To verify the data was loaded correctly, open another query window using the
Transact-SQl Editor ➤ New Query links from the SQl menu. After connecting, select
the Chapter 9 database and execute this query:
select * from State
You should see results similar to Figure 9-9 .
Figure 9-9. The contents of the State table
Creating the Model
Creating a model that uses an SQL table is a pretty simple task. You'll use LINQ to SQL to create a model class
that provides data from the specified table.
eXerCISe 9-5. CreatING a LINQ tO SQL MODeL
From the Solution Explorer, right-click the Models folder and select the Add ➤ New
Item links. In the “Add New Item” dialog box, select the Data category and then
select the “lINQ to SQl Classes” item and enter State.dbml name as shown in
Figure 9-10 .
Search WWH ::

Custom Search