0

这是我的代码,但 gridview 没有出现

VB

Public Sub GridViewBind()
        Dim cmd As New SqlCommand("select * from Evaluation", con)
        Dim da As New SqlDataAdapter(cmd)
        Dim ds As New DataSet()
        da.Fill(ds, "Evaluation")
        GridView1.DataSource = ds.Tables("Evaluation")
        GridView1.DataBind()
    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.GridViewBind()
    End Sub End Class

ASPX

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns = "true"> </asp:GridView> <asp:Button ID="Button1" runat="server" Text="Button" />
4

0 回答 0