<% @ Import namespace = "system. Data" %>
<% @ Import namespace = "system. Data. sqlclient" %>
<HTML>
<Script language = "C #" runat = "server">
Protected void page_load (Object sender, eventargs E)
{
Sqlconnection myconnection = new sqlconnection ("Server = (local) // netsdk; database = pubs; trusted_connection = yes ");
Sqldataadapter mycommand = new sqldataadapter ("select * from authors", myconnection );
Dataset DS = new dataset ();
Mycommand. Fill (DS, "author ");
Mydatagrid. datasource = Ds. Tables ["author"]. defaultview;
Mydatagrid. databind ();
}
</SCRIPT>
<Body>
<H3> <font face = ""> simple selection of the DataGrid Control </font>
<Asp: DataGrid id = "mydatagrid" runat = "server"
Width = "700"
Backcolor = "# ccccff"
Bordercolor = "black"
Showfooter = "false"
Cellpadding = 3
Cellspacing = "0"
Font-name = ""
Font-size = "8pt"
Headerstyle-backcolor = "# aaaadd"
Enableviewstate = "false"
/>
</Body>
</Html>