Noob在這裏,已導入SQL數據庫作爲數據源到表單應用程序,但當我點擊預覽沒有行顯示。VB.Net填充DataGridview與數據集1錶行
Public Class Form1
Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the "DataSet1.Ac_Billbook" table. You can move, or remove it, as needed.
'Me.Ac_BillbookTableAdapter.Fill(Me.DataSet1.Ac_Billbook)
For Each table In DataSet1.Tables
ComboBox1.Items.Add(table.ToString)
Next
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
DataGridView1.DataSource = DataSet1.Tables(ComboBox1.SelectedItem)
'DataGridView1.DataBind()
End Sub
End Class
的想法是,我將能夠通過看錶,快看到它預覽表中的字段。
嘗試'DataSet1.Tables(ComboBox1.SelectedItem).DefaultView' –
GridView控件現在完全空白 –