Dear Friends,
I am developing an application for multi user using vb.net with back end as ms-access. For the table name as employee_master, there is a column, name as student_profile having datatype as Yes/No .
If value of student_profile is "yes" then label1 will be shown and
If value of student_profile is "No" then label2 will be shown
For this I use this code
Private Sub show_userid_employee_no()
Dim dbConn As OleDbConnection
Dim dbCommand As New OleDbCommand
dbConn = New OleDbConnection(cnSettings())
dbCommand.CommandText = "SELECT * FROM [Employee_master] Where User_id = '" & Login_Page.user_id.Text & "' And [password] = '" & Login_Page.password.Text & "'"
dbCommand.Connection = dbConn
dbConn.Open()
Dim dbDR As OleDb.OleDbDataReader = dbCommand.ExecuteReader
Try
While dbDR.Read
Dim label2 As New Label
Dim label4 As New Label
Dim label5 As New Label
Me.Label2.Text = CStr(dbDR("user_id"))
Me.Label4.Text = CStr(dbDR("employee_id"))
Dim Student_profile As Boolean
If Student_profile = True Then
MsgBox("HI vasim")
Else
MsgBox("Who are you")
End If
End While
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")
Finally
dbConn.Close()
End Try
End Sub