<%@ 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:Repeater ID="AllCustomer" Runat="server"
 >
	<HeaderTemplate>
		所有已来往的客户：<br>
	</HeaderTemplate>
	<SeparatorTemplate>
		---------------------------------------------------------------------<br>
	</SeparatorTemplate>
	<ItemTemplate>
	客户编号：<asp:Label Text='<%# DataBinder.Eval(Container.DataItem,"CusID")  %>' id="CusID" Runat="server" /><br>
	客户名称：<asp:Label Text='<%# DataBinder.Eval(Container.DataItem,"CusLongName") %>' id="Name" Runat="server" /><br>
	地址：<asp:Label Text='<%# DataBinder.Eval(Container.DataItem,"CusAddress") %>' id="CusAddress" Runat="server" /><br>
	电话：<asp:Label Text='<%# DataBinder.Eval(Container.DataItem,"Tel1") %>' id="Tel1" Runat="server" /><br>
	</ItemTemplate>
</asp:Repeater>
</form>
</body>