<%@ Register TagPrefix="Title" TagName="TitleShow" Src="/aspnetdata/Title.ascx" %>
<%@Page Debug=True %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Web" %>
<html>
<head>
	<script language="C#" runat="server">
	SqlConnection Source;
	string d="SELECT * from Customers";
	void Page_load(object sender,EventArgs e){
		Source = (SqlConnection)Session["NowSTKSQL"];
		if(IsPostBack==false){
			bindNew(true);
			}
	}
	void bindNew(Boolean tag){//结合至DataGrid
		if(tag==true){
			DataSet DS = new DataSet();
			SqlDataAdapter NComm = new SqlDataAdapter(d, Source);
			NComm.Fill(DS, "Customers");
			Session["NowDS"]=DS;//声明为Session
			AllCustomer.DataSource=DS.Tables["Customers"].DefaultView;
			AllCustomer.DataBind();
		}
		else{
			DataSet DS=(DataSet)Session["NowDS"];
			AllCustomer.DataSource=DS.Tables["Customers"].DefaultView;
			AllCustomer.DataBind();
		}
	}
	</script>
</head>
<body background="/aspnetdata/images/winback.gif">
<Title:TitleShow id="BookT" Runat="server" />
<form runat="server">
<asp:DataList id="AllCustomer" runat="server"
	BorderColor="black"	BorderWidth="1"
	GridLines="Both"	CellPadding="3"
	CellSpacing="0"		Font-Name="Verdana"
	Font-Size="8pt"		RepeatColumns="3"
	Width="500px"	HeaderStyle-BackColor="#C0FFFF"
	AlternatingItemStyle-BackColor="Gainsboro"
	>
	<HeaderTemplate>
		客户基本资料
	</HeaderTemplate>
	<ItemTemplate>
		客户编号：<%# DataBinder.Eval(Container.DataItem,"CusID")  %><br>
		公司名称：<%# DataBinder.Eval(Container.DataItem,"CusLongName")  %><br>
		连络人：<%# DataBinder.Eval(Container.DataItem,"Contact") %><br>
	</ItemTemplate>
</asp:DataList>
</form>
</body>