[size=2][color=#0000ff]Private[/color][/size][size=2][color=#0000ff]Sub[/color][/size][size=2] Button2_Click([/size][size=2][color=#0000ff]ByVal[/color][/size][size=2] sender [/size][size=2][color=#0000ff]As[/color][/size][size=2] System.Object, [/size][size=2][color=#0000ff]ByVal[/color][/size][size=2] e [/size][size=2][color=#0000ff]As[/color][/size][size=2] System.EventArgs) [/size][size=2][color=#0000ff]Handles[/color][/size][size=2] Button2.Click
[/size][size=2][color=#0000ff][u]Private[/u][/color][/size][size=2] cnn [/size][size=2][color=#0000ff]As[/color][/size][size=2] OleDbConnection = [/size][size=2][color=#0000ff]New[/color][/size][size=2] OleDbConnection("connectionStringGoesHere")
[/size][size=2][color=#008000]'see www.connectionstrings.com
[/color][/size][size=2][color=#0000ff][u]Private[/u][/color][/size][size=2] dt [/size][size=2][color=#0000ff]As[/color][/size][size=2][color=#0000ff]New[/color][/size][size=2] DataTable("categories")
[/size][size=2][color=#0000ff]Dim[/color][/size][size=2] strSQL [/size][size=2][color=#0000ff]As[/color][/size][size=2][color=#0000ff]String[/color][/size][size=2] = "select * from myTable " & _
"WHERE name = 'name' AND address = 'address'"
[/size][size=2][color=#0000ff]Dim[/color][/size][size=2] da [/size][size=2][color=#0000ff]As[/color][/size][size=2] OleDbDataAdapter = [/size][size=2][color=#0000ff]New[/color][/size][size=2] OleDbDataAdapter(strSQL, cnn)
[/size][size=2][color=#0000ff]Try
[/color][/size][size=2]cnn.Open()
da.Fill(dt)
[/size][size=2][color=#0000ff]Catch[/color][/size][size=2] exc [/size][size=2][color=#0000ff]As[/color][/size][size=2] Exception
MessageBox.Show(exc.ToString)
[/size][size=2][color=#0000ff]Finally
[/color][/size][size=2][color=#0000ff]Try
[/color][/size][size=2]cnn.Close()
[/size][size=2][color=#0000ff]Catch[/color][/size][size=2] : [/size][size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]Try
[/color][/size][size=2]da.Dispose()
cnn.Dispose()
[/size][size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]Try
[/color][/size][size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]Sub
[/color][/size]