<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>

<html>
<script language="VB" runat="server">

    Sub Page_Load(Src As Object, E As EventArgs) 
		'创建数据集
        Dim DS As DataSet
		'创建数据连接对象
        Dim SConn As SqlConnection
		'创建命令集对象
        Dim SComm As SqlDataAdapter
		
		'位数据连接对象咐值
Sconn=New  SqlConnection("server=cm\cm;Trusted_Connection=yes;database=model")
        
SComm = New SqlDataAdapter("find_member", SConn)

        '设置命令对象类型为存储过程 
        SComm.SelectCommand.CommandType = CommandType.StoredProcedure

        '建立和填充数据集 
        DS = new DataSet()
        SComm.Fill(DS, "forum")

        SDG.DataSource=DS.Tables("forum").DefaultView
        SDG.DataBind()
    End Sub

</script>

<body>
<center>
  <h3><font face="Verdana">采用存储过程的方式从数据库中调用数据！！</font></h3>

  <ASP:DataGrid id="SDG" runat="server"
    Width="360"
    BackColor="#ccccff" 
    BorderColor="black"
    ShowFooter="false" 
    CellPadding=3 
    CellSpacing="0"
    Font-Name="Verdana"
    Font-Size="8pt"
    HeaderStyle-BackColor="#aaaadd"
    MaintainState="false"
  />
</center>
</body>
</html>
