我试图更改 datagridview 中的行颜色,但曾经为我工作的代码需要一个数据集。这是我用来填充我的 datagridview 的代码
Dim sql As String
sql = "SELECT * FROM [product info]"
Dim adapter As New OleDbDataAdapter(sql, strcon)
Dim dt As New DataTable("[product info]")
adapter.Fill(dt)
DataGridView1.DataSource = dt
Dim sql1 As String
sql1 = "SELECT * FROM [product info]"
Dim adapter1 As New OleDbDataAdapter(sql1, strcon)
Dim cmd As New OleDbCommand(sql1, strcon)
strcon.Open()
Dim myreader As OleDbDataReader = cmd.ExecuteReader
myreader.Read()
strcon.Close()
如何在这行代码中声明数据集?