I add user account and i add Again with same username and password
how to make error message sample MsgBox("Account is already registered")

Get you Accinfo table into a datatable (dt). You should have a TextBox to insert accname (TextBox1).

    Private Sub TextBox1_Validated(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.Validated
        For i As Integer = 0 To Dt.Rows.Count - 1
            If TextBox1.Text = Dt.Rows(i).Item("Text").ToString Then
                MsgBox("Acc has ...")
                Exit For
            End If
        Next
    End Sub

or simply select all the records with the same username and/or password then if there is a present record.. show a messagebox telling the user that "Account already exist.. Go fvck yourself!" :)

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.