<%@ Register TagPrefix="Title" TagName="TitleShow" Src="/aspnetdata/Title.ascx" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Web" %>
<html>
<head>
    <script language="C#" runat="server">
	SqlConnection ep;
	DataSet DS =new DataSet();
	void Page_Load(object sender,EventArgs e){
		ep=new SqlConnection("server=localhost;uid=sa;database=EmploySQL");
		SqlDataAdapter Staff=new SqlDataAdapter("Select * from Staff",ep);
		Staff.Fill(DS,"Staff");
		AllStaff.DataSource=DS.Tables["Staff"].DefaultView;
		AllStaff.DataBind();
	}
    </script>
</head>
<body background="/aspnetdata/images/winback.gif">
<Title:TitleShow id="BookT" Runat="server" />
    <form runat="server">
	<ASP:DataGrid id="AllStaff" runat="server"
		DataKeyField="SID"
		AutoGenerateColumns="false"
		width="100%"
		BorderColor="red"
		BorderWidth="1"
		GridLines="Both"
		CellPadding="1"
		CellSpacing="1"
		itemstyle-height="10"
		Font-Name="Verdana"
		Font-Size="11pt"
		HeaderStyle-BackColor="#dcdcdc"
		AlternatingItemStyle-BackColor="#eeeeee"
		HeaderStyle-font-bold="True"
		SelectedItemStyle-BackColor="#FFFFC0"
		SelectedItemStyle-Bold=True >
	<columns>
	<asp:BoundColumn HeaderText="SID" ReadOnly="True" DataField="SID" ItemStyle-Wrap="false"/>
	<asp:BoundColumn HeaderText="Name" DataField="cname"/>
	<asp:BoundColumn HeaderText="PID" DataField="pid"/>
	<asp:BoundColumn HeaderText="Birthday" DataField="Bday" DataFormatString="{0:yyyy/MM/dd}" />
	<asp:BoundColumn HeaderText="Sex" DataField="sex"/>
	<asp:BoundColumn HeaderText="Address" DataField="Address_contact"/>
	<asp:BoundColumn HeaderText="TEL" DataField="TEL"/>
	</columns>
</ASP:DataGrid>
</form>
</body>