Exemplo Prático (6)
•Dim ds As DataSet
•Dim conn As OleDb.OleDbConnection
•Dim cmd As OleDb.OleDbDataAdapter
•Dim strSQL As String, strAux As String
•strAux = "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\develop\web\dados\nwind.mdb"
strSQL = "SELECT CompanyName As Empresa, " & _
• "ContactName As Contato, Phone As Telefone " & _
• "From Customers Order By CompanyName "
•conn = New OleDb.OleDbConnection(strAux)
•cmd = New OleDb.OleDbDataAdapter(strSQL, conn)
•ds = New DataSet()
•cmd.Fill(ds, "Customers")
•gridView1.DataSource = ds.Tables("Customers").DefaultView
•gridView1.DataBind()