Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Try
- sqlcon.Open()
- sqlcmd = New SqlCommand(query, sqlcon)
- Dim accountName As String = TBUsername.Text
- 'sqlcmd.Parameters.AddWithValue("@accountName", accountName)
- sqlcmd.ExecuteNonQuery()
- Dim reader As SqlDataReader = sqlcmd.ExecuteReader()
- If reader.HasRows Then
- While reader.Read()
- SQLPassword = reader("UserPassword").ToString()
- UserName = reader("UserName").ToString()
- GivenPassword = TBPassword.Text
- If SQLPassword = GivenPassword And UserName = TBUsername.Text Then
- Queries.Show()
- Else
- Form1.Show()
- End If
- End While
- End If
- Me.Close()
- Catch ex As Exception
- MsgBox(ex.Message)
- Throw ex
- Finally
- If sqlcon.State = ConnectionState.Open Then
- sqlcon.Close()
- End If
- End Try
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement