<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<html>
<script language="VB" runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
Dim DS As DataSet
Dim MyConnection As SqlConnection
Dim MyCommand As SqlDataAdapter
MyConnection = New SqlConnection("Password=better;Persist Security Info=True;User ID=sa;Initial Catalog=MY;Data Source=GISSERVER")
MyCommand = New SqlDataAdapter("select * from sys_sblb", MyConnection)
DS = new DataSet()
MyCommand.Fill(ds, "作者")
MyDataGrid.DataSource=ds.Tables("作者").DefaultView
MyDataGrid.DataBind()
End Sub
</script>
<body>
<h3><font face="宋体">DataGrid 控件的简单选择</font></h3>
<ASP
ataGrid 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>
呵呵,文档中的。