各位幫我看看那里有錯
Dim strcmd As StringDim sqlcon As SqlConnection = New SqlConnection(strcon)
sqlcon.Open()
strcmd = "select id from t_login"
Dim sqlcmd As SqlCommand = New SqlCommand(strcmd, sqlcon)
Dim dr As SqlDataReader
dr = sqlcmd.ExecuteReader
Do While dr.Read()
If Trim(ComboBox1.Text) = dr.Item(0) Then '這里我的數據庫里有相對應的資料但是不行運以下代碼
MsgBox("a")
Exit Sub
ElseIf Trim(ComboBox1.Text) <> dr.Item(0) Then’反而運行這里,也就是未找到
MsgBox("用戶ID錯誤或不存在請查檢!")
End If
Loop