Private Sub Form1_Load(ByVal sender As System.Object, ByVal _
e As System.EventArgs) Handles MyBase.Load
Dim dt As New DataTable("People")
dt.Columns.Add("First Name")
dt.Columns.Add("Last Name")
dt.Columns.Add("Occupation")
dt.Rows.Add(New Object() {"Rod", "Stephens", "Nerd"})
dt.Rows.Add(New Object() {"Sergio", "Aragones", _
"Cartoonist"})
dt.Rows.Add(New Object() {"Eoin", "Colfer", "Author"})
dt.Rows.Add(New Object() {"Terry", "Pratchett", "?"})
DataGridView1.DataSource = dt
End Sub
|