1. Add the following references to the project. using System.Data.Linq.Mapping; using System.Data.Linq; 2. Create entity class. [Table(Name = "Customers")] public class Customer { [Column(IsPrimaryKey = true)] public string CustomerID { get; set; } [Column(Name = "ContactName")] public string Name { get; set; } [Column] public string City { get; set; } } 3. Bind data protected void Page_Load(object sender, EventArgs e) { DataContext ctx = new DataContext("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Northwind;Data Source=MySQLServer"); Table<Customer> Customers = ctx.GetTable<Customer>(); GridView1.DataSource = from c in Customers where c.CustomerID.StartsWith("A") select new { 顾客ID = c.CustomerID, 顾客名 = c.Name, 城市 = c.City }; GridView1.DataBind(); }