真是的,看来你是不是没有看过什么书啊!
代码
Dim mystr As String = "server=fixedchen;database=northwind;uid=sa;pwd=;"
Dim mycon As New SqlConnection(mystr)
Dim myadapter As New SqlDataAdapter("SELECT * FROM Orders WHERE OrderDate = '1996-8-1'", mycon)
Dim mytable As New DataSet
myadapter.Fill(mytable)
DataGrid1.DataSource = mytable.Tables(0)