Problem is this i want to make two kind of user one user can only add and search records and other should be administrator how can i do this please guide me thanks in advance for yuor help.
Dim cnString As String = "Data Source=ITS;Initial Catalog=Payment;Integrated Security=True"
'Create connection
Dim conn As SqlConnection = New SqlConnection(cnString)
Dim sql = "SELECT Username,Pass FROM Login WHERE Username = '" & UsernameTextBox.Text & "' AND Pass = '" & PasswordTextBox.Text & "'"
conn.Open()
Dim cmd As SqlCommand = New SqlCommand(sql, conn)
Dim dr As SqlDataReader = cmd.ExecuteReader
Try
Catch ex As InvalidOperationException
MsgBox(ex.Message)
End Try
Try
If dr.Read = False Then
MessageBox.Show("Please try again!", "ALI ENTERPRISES", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
MessageBox.Show("Login Successfull......!", "ALI ENTERPRISES", MessageBoxButtons.OK, MessageBoxIcon.Information)
Me.Close()
Form11.Show()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
If conn.State <> ConnectionState.Closed Then
conn.Close()
End If

New Topic/Question
Reply




MultiQuote





|