ADO Net Database ASP.Net Tutorial

using System;
using System.Web.Configuration;
using System.Collections.Generic;
public class ProductCollection
{
    public List GetProducts()
    {
        List products = new List();
        products.Add("A");
        products.Add("B");
        products.Add("C");
        return products;
    }
}
File: index.aspx
<%@ Page Language="C#" %>
   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">


    Show Product Collection


    
    

            id="grdProducts"
        DataSourceID="srcProducts"
        Runat="server" />
            id="srcProducts"
        TypeName="ProductCollection"
        SelectMethod="GetProducts"
        Runat="server" />
    

    


File: Web.config

  
             connectionString="Data Source=.\SQLEXPRESS;
         AttachDbFilename=|DataDirectory|MyDatabase.mdf;Integrated Security=True;User Instance=True" />