VB.NET:
Dim con As New OleDb.OleDbConnection
Dim da As New OleDb.OleDbDataAdapter
Dim ds As New DataSet
Dim cm As New OleDb.OleDbCommand
Dim read As OleDb.OleDbDataReader
Dim sql As String
VB.NET:
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:\proj\Module_1_Encoder\Module_1_Encoder\enrollment.mdb"
con.Open()
sql = "SELECT * FROM tblOld Where Studnum=" & StudNumMaskedTextBox.Text & ""
cm.Connection = con
cm.CommandText = sql
da = New OleDb.OleDbDataAdapter(sql, con)
da.Fill(ds, "tblOld")
read = cm.ExecuteReader
read.Read()
txtFName.Text = read.Item("FName")
txtLName.Text = read.Item("LName")
con.Close()