Rowel Virgo
asked on
Hi I have a question in VB.net From SQL
Dim cmd As MySqlCommand = conn.CreateCommand()
cmd.CommandText = "SELECT * FROM rsv.tbl_accounts where user_name = '" & TextBox6.Text & "'"
cmd.CommandType = CommandType.Text
conn.Close()
conn.Open()
Dim count = cmd.ExecuteScalar()
cmd.Clone()
Label21.Text = count
About the above code, I want to display the user_name in Label21.text but it display the first column of the table from database because the user_registration_date is in the first column and the user_name is on the 3rd column. How can I display it? The 'rowelv' in Label21.text ???
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
first of all
1. why do you close and open connection?
2. whats the point of providing username and selecting username?
3. whats the point of cmd.Clone()? do you mean cmd.Close()?
1. why do you close and open connection?
2. whats the point of providing username and selecting username?
3. whats the point of cmd.Clone()? do you mean cmd.Close()?
Welcome.
ASKER
first of all
1. why do you close and open connection?
2. whats the point of providing username and selecting username?
3. whats the point of cmd.Clone()? do you mean cmd.Close()?
It's a mistakes again sir
ASKER