Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
        Try
            Dim usr, pswd As String
            Dim i, n As Integer

            obcon.con.Open()
            obcon.cmndcon()
            obcon.cmnd.CommandText = "select count(*) from users "
            n = obcon.cmnd.ExecuteScalar
            MsgBox("n=" & n)

            For i = 1 To n Step 1
                obcon.cmnd.CommandText = "select usr_name from users where usr_id= " & i
                If obcon.cmnd.ExecuteScalar = txtusrfrmlgn.Text Then
                    usr = obcon.cmnd.ExecuteScalar
                    MsgBox(usr)

                End If
                MsgBox(i)
            Next

            For i = 1 To n Step 1
                obcon.cmnd.CommandText = "select usr_pswrd from users where usr_name='" & usr & "'"
                MsgBox(txtpswdfrmlgn.UseSystemPasswordChar)
                If txtpswdfrmlgn.UseSystemPasswordChar = True Then
                    pswd = obcon.cmnd.ExecuteScalar
                    MsgBox(pswd)
                End If

            Next

        Catch ex As Exception

            MsgBox(ex.Message)
        Finally
            obcon.con.Close()
        End Try




    End Sub

If the user has entered text into a text box, you can just simply use the TextBox.Text method.

A password character is just a way to hide the displayed text, the true text typed is still stored in the textbox's text string variable.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.