This is what my shape looks like - an image .
When the forms load, I would like to get the data of the player whose username
is in Label1
, so I could display his points
in Label2
.
Here is my code:
Dim conn As MySqlConnection conn = New MySqlConnection("server=REMOVED;Port=REMOVED; user id=REMOVED; password=REMOVED; database=REMOVED") Dim username As Boolean = True conn.Open() Dim sqlquery As String = "SELECT Name FROM NewTable WERE Name='" & My.Settings.Name & "';" Dim data As MySqlDataReader Dim adapter As New MySqlDataAdapter Dim command As New MySqlCommand command.CommandText = sqlquery command.Connection = conn adapter.SelectCommand = command data = command.ExecuteReader While data.Read() Label1.Text = data(1).ToString Label2.Text = data(3).ToString End While data.Close() conn.Close()
Any help would be greatly appreciated.
source share