Private Sub ViewUser_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try Dim connection As New MySqlConnection("server=" & My.Settings.MysqlHost & ";user id=" & My.Settings.MysqlUsername & "; password=" & My.Settings.MysqlPassword & "; port=3306; database=" & My.Settings.MysqlDatabase & "; pooling=false") connection.Open() Dim usersql As New MySqlCommand("SELECT * FROM `accounts` WHERE `id` = '" & My.Settings.VUID & "' LIMIT 1", connection) usersql.ExecuteNonQuery() Dim userreader = usersql.ExecuteReader() While (userreader.Read()) Dim name As String = userreader.GetString(1) & " " & userreader.GetString(2) Dim accounttype = "" Dim activity = userreader.GetString(8) accname.Text = StrConv(name, VbStrConv.ProperCase) accid.Text = userreader.GetString(0) accemail.Text = userreader.GetString(3) accusername.Text = userreader.GetString(4) If userreader.GetString(9).Equals(1) Then accounttype = "Tenant" setpaid.Hide() setunpaid.Hide() ElseIf userreader.GetString(9).Equals(2) Then accounttype = "Landlord" End If If activity.Equals(1) Then accactive.Text = "Suspended" suspenduser.Hide() Else accactive.Text = "Active" unsuspend.Hide() End If acctype.Text = accounttype usersql.Dispose() End While Catch ex As MySqlException MessageBox.Show(ex.Message) End Try End Sub
If userreader.GetString(9).Equals(1) Then accounttype = "Tenant" setpaid.Hide() setunpaid.Hide() ElseIf userreader.GetString(9).Equals(2) Then accounttype = "Landlord" End If If activity.Equals(1) Then accactive.Text = "Suspended" suspenduser.Hide() Else accactive.Text = "Active" unsuspend.Hide() End If
.Equals("1")
GetInt(x).Equals(1)
Select Case CType(userreader.GetString(9), Integer) Case 1 Case 2 Case 9 Case Else End Select
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)