hello everyone...
i`m totally new to vb actually.now using vb express 2008.i`m currently trying to create log in function.basically, i`m already create database (database in vb 2008 itself) for login,which the login table contain 3 columns, Username, Password and Designation.example : Username -- Password -- Designation
jack -- 123abc -- consultant
jane -- lovely -- project manager
matt -- mummy -- consultant
anna -- pass12 -- system admin

At the form design, i put textbox control for username and password, and combobox for designation.

1. The thing is, how can i make validation from user input when login, to the data that stored in the login table?

2. How can i display only certain list in the designation combobox?because, i did set the"DataSource" at the property as connected to the column designation,but its display consultant 2 times.what i need is,to display - consultant,project manager,system admin and client.

I do need designation in login because different personnel will go to different page.

Sorry for the wordy questions.I hope you guys can help me. Thanks.

Edited 6 Years Ago by drakkar: n/a

>how can i make validation from user input when login..

Use Regex (regular expression).

>How can i display only certain list in the designation combobox.

DISTINCT clause.

SELECT DISTINCT Column1  FROM tablename

Thanks a lot for your reply. if i`m not out of a line, can anyone share sample project that may involve login,save,update,delete,display data from .mdf database? thanks.

i`m gonna have 4 type of personnels that might login to the system. the login will ask username,password and designation. so this code below i made to let each personnel go to their authorized window. but this code seems not working. what might goes wrong down here? it didn't go to the form specified to.

Dim count = DataSet.Tables(0).Rows.Count

        If count > 0 Then
            If ComboBox1.Text = "manager" Then
                Form2.Show()
                Me.Hide()
            ElseIf ComboBox1.Text = "consultant" Then
                Form3.Show()
                Me.Hide()
            ElseIf ComboBox1.Text = "client" Then
                Form4.Show()
                Me.Hide()

            End If
            
        Else
            MsgBox("Incorrect login , Please check Username, Password and Designation", MsgBoxStyle.Critical)
            TextBox1.Clear()
            TextBox2.Clear()

Edited 6 Years Ago by __avd: Added [code] tags. For easy readability, always wrap programming code within posts in [code] (code blocks).

this one solved already. i made a silly mistake. forgot about case sensitive, thats why it doesn't work.

This question has already been answered. Start a new discussion instead.