hi am a newbie to the vb.net thing. am using ms access for my database. i have a customer table in my database where sutomer details like first name, last name, address, etc are stored. i've created a form in vb.net and i have a text box, a datagrid and a search button. i want to do a search by name when i enter a customer name in the text box. the customer information will be displayed in the datagrid just like in a database. i can't write the codes and i have spent days looking for codes on the net. all i get is sql ones and am not familiar with sql. here are some codes i have been able to write to connect the database. not sure if it's good though.
please help me out.
Dim UP As New OleDb.OleDbCommand
Dim Con As New OleDb.OleDbConnection
Dim Read As OleDb.OleDbDataReader
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
Con.Open()
MsgBox("A Connection to the Database is now open")
End Sub
Private Sub frmSearch_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Replace(Application.StartupPath, "bin", "") & "DataStore.mdb;Mode=ReadWrite;Persist Security Info=False"
UP.Connection = Con
UP.CommandType = CommandType.Text
UP.CommandText = "Select Customer * From Customer "
End Sub
Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
Me.Close()
End Sub