<%@ Import Namespace="System.Data" %> 
<%@ Import NameSpace="System.Data.SqlClient" %> 
<script laguage="C#" runat="server"> 
   public void Page_Load(Object src,EventArgs e)
   {
   myConnection SqlConnection;
   myCommand SqlCommand;
   ds DataSet; 
   myConnection = New SqlConnection("server=192.168.101.9;database=SmartExam;uid=sa;pwd=gzedu"); 
   myConnection.Open(); 
   la1.text="Connection Opened!"; 
   myCommand = New SqlCommand("select * from User_Account",myConnection);
   MyDataGrid.DataSource=myCommand.ExecuteReader(); 
   MyDataGrid.DataBind();
   }
</script>
<html>
<body>
 <ASP:DataGrid id="MyDataGrid" runat="server" 
   BorderColor="black" 
   BorderWidth="1" 
   GridLines="Both" 
   CellPadding="3" 
   CellSpacing="0" 
   Font-Name="Verdana" 
   Font-Size="10pt" 
   HeaderStyle-BackColor="#aaaadd" 
   AlternatingItemStyle-BackColor="#eeeeee" 
   > 
   </asp:DataGrid> 
<%
   String account=Request.Form["username"];
   String password=Request.Form["password"];   Response.Write(account);
   
 %>
</body>
</html>