0
studentrecords表,。,包含IDNumber中,姓氏,當然,名字加載數據到我的MainForm
我將通過使用IDNumber中我的系統,一旦我去MainForm的iwant顯示姓氏,當然到2登錄。文本框在使用的IDNumber作爲其主鍵的MainForm,我的代碼錯誤
昏暗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()
它只加載IDNumber –