hey all. I'm designing a new software and working on login system with online database.
this is the code that I wrote, it work well
Mysqlconn.ConnectionString = "server=db4free.net;Port=3306; user id=****; password=d****; database=****g" Mysqlconn = New MySqlConnection Dim READER As MySqlDataReader Try Mysqlconn.Open() Dim Query As String Query = "SELECT * FROM *f*a*e* WHERE Name='" & TextBox1.Text & "' AND Password='" & TextBox2.Text & " ' " Command = New MySqlCommand(Query, Mysqlconn) READER = Command.ExecuteReader Dim count As Integer count = 0 While READER.Read count = count + 1 End While If count = 1 Then MsgBox("Welcome'" & TextBox1.Text & "'") FORMAKRYESORE.Show() Me.Close() ElseIf count > 1 Then MsgBox("Welcome'" & TextBox1.Text & "'") Else MsgBox("Sorry did not recognize you. Re-enter name and password") End If Mysqlconn.Close() Catch ex As MySqlException MsgBox(ex.Message) Finally Mysqlconn.Dispose() End Try
It work perfectly. what Im trying to make is, if I log with my name. for example. "altjen" it show an other form with the details that are on the database, for example my name age and what I put there.
PS: will use this as a mini chatting software between my friends