studentrecords 表.,., 包含 IDNumber,LastName,Course,Firstname
我将使用 IDNumber 通过我的系统登录,一旦我进入主窗体,我想使用 IDNumber 作为主键显示 LASTname 和课程到主窗体中的 2 个文本框。,我的代码错误
将 con 调暗为新的 OleDbConnection 将 cmd 调暗为新的 OleDbCommand
Dim da As New OleDbDataAdapter
Dim dt As New DataTable
Dim sSQL As String = String.Empty
'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()