imports system.data.sqlclient
mysqlconn = New SqlConnection
mysqlconn.ConnectionString = "Data Source=" + txtServerName.Text + ";initial catalog=" + txtdatabasename.Text + ";initial catalog=" + txtshardacc.Text + ";user id=" + textusername.Text + ";password=" + txtpassword.Text
Dim queryresult As Integer
Try
mysqlconn.Open()
command = New SqlCommand("select COUNT (*) as numRows from _Char Where CharName16='" & TextBox40.Text & "'", mysqlconn)
queryresult = command.ExecuteScalar
mysqlconn.Close()
If queryresult = 0 Then
MsgBox("charactername not found ", MsgBoxStyle.Critical, "Error")
Else
MsgBox("(1) Username Found " & TextBox40.Text, MsgBoxStyle.Information, "Done")
TextBox29.Enabled = True
TextBox30.Enabled = True
TextBox31.Enabled = True
TextBox32.Enabled = True
TextBox32.Enabled = True
TextBox33.Enabled = True
TextBox34.Enabled = True
TextBox35.Enabled = True
TextBox36.Enabled = True
TextBox37.Enabled = True
TextBox38.Enabled = True
TextBox39.Enabled = True
Try
mysqlconn.Open()
Dim reader As SqlDataReader
reader = command.ExecuteReader
If reader.HasRows Then
TextBox39.text = reader.Item("Curlevel")
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Abdelaziz_1 -1 Newbie Poster
rproffitt 2,662 "Nothing to see here." Moderator
Abdelaziz_1 -1 Newbie Poster
rproffitt 2,662 "Nothing to see here." Moderator
Santanu.Das 125 Santanu Das
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.