File: ~\App_Code\Product.cs
using System;
using System.Data.Linq.Mapping;
[Table]
public class Product
{
[Column(IsPrimaryKey=true, IsDbGenerated=true)]
public int Id { get; set; }
[Column]
public string Title { get; set; }
[Column]
public string Director { get; set; }
[Column]
public DateTime DateReleased { get; set; }
[Column]
public decimal Totals { get; set; }
}
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Web.Configuration" %>
<%@ Import Namespace="System.Linq" %>
<%@ Import Namespace="System.Data.Linq" %>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
File: Web.config
connectionString="Data Source=.\SQLEXPRESS;
AttachDbFilename=|DataDirectory|MyDatabase.mdf;Integrated Security=True;User Instance=True" />