我有 DataTable 的数据。分配给 gridview ,但 gridview 在分配后有 0 行。
Dim mKeywordSearch As New KeywordSearch
Dim dtExcel As DataTable
dtExcel = mKeywordSearch.DatabaseKeywordSearch(txtKeyword.Text)
gvKeywordSearch.DataSource = dtExcel
gvKeywordSearch.DataBind()
Dim cnt As Integer = dtExcel.Rows.Count
cnt = gvKeywordSearch.Rows.Count()
.aspx 页面
<asp:GridView ID="gvKeywordSearch" runat="server" Width="100%"
AutoGenerateColumns="false" Visible="true"></asp:GridView>