<%@ 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="vb" runat="server">
	dim Source as SqlConnection
	Dim d as string ="SELECT * from Customers"
	sub Page_load(Sender as object,e as EventArgs)
		Source = Ctype(Session("NowSTKSQL"),SqlConnection)
		if IsPostBack=false then
			bindNew(true)
		end if
	end sub
	sub bindNew(tag as Boolean)
		if tag =true then
			Dim DS as DataSet = new DataSet()
			Dim NComm as SqlDataAdapter = new SqlDataAdapter(d, Source)
			NComm.Fill(DS, "Customers")
			Session("NowDS")=DS
			AllCustomer.DataSource=DS.Tables("Customers").DefaultView
			AllCustomer.DataBind()
		else
			Dim DS as DataSet =Ctype(Session("NowDS"),DataSet)
			AllCustomer.DataSource=DS.Tables("Customers").DefaultView
			AllCustomer.DataBind()
		end if
	end sub
	</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>