studentrecords table.,.,contains IDNumber,LastName,Course,Firstname
i will login through my system using IDNumber and once i go to the mainform iwant to display LASTname and course to the 2 textboxes in the mainform using the IDNumber as their Primary Key.,.My code errors
Dim con As New OleDbConnection
Dim cmd As New OleDbCommand
Dim da As New OleDbDataAdapter
Dim dt As New DataTable
Dim sSQL As String = String.Empty
'try catch block is used to catch the error
'get connection string declared in the Module1.vb and assing it to conn variable
con = New OleDbConnection(Get_Constring)
con.Open()
cmd.Connection = con
cmd.CommandType = CommandType.Text
sSQL = "SELECT LastName FROM studentsrecords where IDNumber like '%" & studentslogin.[txtIDNumber].Text & "%' order by ID desc"
cmd.CommandText = sSQL
da.SelectCommand = cmd
da.Fill(dt)
'evalutionrate.[lbllogin].Text = studentslogin.[txtIDNumber].Text
evalutionrate.[lbllogin].Text = sSQL
evalutionrate.Show()