vb.net+dbgrid(初学)
Dim conn As New OleDbConnection
Dim adapter1 As New OleDbDataAdapter
Dim dsr As DataSet
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & CurDir() & "\book.mdb "
conn.Open()
adapter1.SelectCommand.CommandText = "select * from manager "
adapter1.Fill(dsr)
Me.DataGrid1.DataSource = dsr
提示:adapter1.SelectCommand.CommandText = "select * from manager "其他信息: 未将对象引用设置到对象的实例
[解决办法]
事先設定datagrid的樣式...