views:

205

answers:

1

Hey guys,

I have some code here that connects to my Mysql database. It checks your username and password and if your login was successful and it retrieves the phone number under that account. How would the SQL Query look like for retrieving the phone number once connected? Then how would I be able to display that phone number on a label?

Thanks

+2  A: 

Have a look at this tutorial, should cover most of what you would need to know about connecting to MySQL, executing queries and displaying results:

VBMySQL Tutorial - Part 4

There are a number of other tutorials on that site, should get you going.

If part 4 gets into too much depth too quickly, check out part 1 first

Sean
I don't think those tutorials answer my questions.
Kevin
You're asking how to query a database, and display data on a label in VB.NET. Those tutorials cover that in detail. Read the part that titled: Retrieving the User ID With A Parameterized Query. And rather than a UserID returned, you'd return the PhoneNumber, set it to a String. Then myControl.Text = PhoneNumber.
Sean