Dim sqlselect As String = "select * from commitee where commitee_id=" & TextBoxUser.Text
แบบชาวโลกเขาทำกันก็ Code (VB.NET)
Dim sqlselect As String = "select * from commitee where commitee_id=@commitee_id"
Dim olecommand As New OleDbCommand(sqlselect, cnn)
olecommand.Parameters.AddWithValue("@commitee_id", CInt(TextBoxUser.Text))
'ไม่เกี่ยวกับ error แต่ถ้าใช้แค่ record เดียวก็เอามาแค่ record เดียวพอ
olereader = olecommand.ExecuteReader(CommandBehavior.SingleRow)
'ถ้า read แล้วเจอข้อมูลในทำคำสั่ง
If (olereader.Read())
'Found.
Else
'Not found
End If