-
Oct 6th, 2013, 01:51 AM
#1
Thread Starter
New Member
VB.NET | Finding Name with Email?
Hi Guys,
Here's my table:
|
UserID |
Email |
Password |
NameandSurname |
Country |
|
1 |
example@domain.com |
12345 |
Great Guy |
Turkey |
In this table, i show user's name on label using his email.
I've tried Find with Rows count, find with rows, columns coordinate but they didn't work.
What should i do? Can anyone help me?
-
Oct 6th, 2013, 02:54 AM
#2
Re: VB.NET | Finding Name with Email?
Are you asking how to retrieve the data from the database or do you already have the data in a DataTable and you want to get it from there? Maybe you could show us an example of what you've already tried so we can point out where you're going wrong?
-
Oct 6th, 2013, 03:17 AM
#3
Thread Starter
New Member
Re: VB.NET | Finding Name with Email?
Originally Posted by jmcilhinney
Are you asking how to retrieve the data from the database or do you already have the data in a DataTable and you want to get it from there? Maybe you could show us an example of what you've already tried so we can point out where you're going wrong?
Users login with own email and password. And after login, Main form opens and user's name will writes in label. But i can't get it. I get it with user's email.
(Sorry for broken English )
-
Oct 6th, 2013, 03:26 AM
#4
Thread Starter
New Member
Re: VB.NET | Finding Name with Email?
And there is no dataset in form but if it necessary, i'll add.
-
Oct 6th, 2013, 04:36 AM
#5
Re: VB.NET | Finding Name with Email?
It's just a query with a WHERE clause. There are examples all over the place. Again, maybe you could show us what you've tried and we can help you fix it. That's much more worthwhile than our just writing your code for you.
-
Oct 11th, 2013, 08:33 AM
#6
Thread Starter
New Member
Re: VB.NET | Finding Name with Email?
Dear jmcilhinney,
Thanks for interest, but i don't know how to use WHERE and how to show result.
Here's my code;
Code:
Dim conn As MySqlConnection
conn = New MySqlConnection
conn.ConnectionString = "my connection string"
Try
conn.Open()
Catch myerror As MySqlException
'Error message (I'll do it.)
End Try
Dim myAdapter As New MySqlDataAdapter
Dim SQLQuery As String = "SELECT * FROM Kullanicilar WHERE Email" 'Don't know how to use "WHERE"
Dim myCommand As New MySqlCommand
myCommand.Connection = conn
myCommand.CommandText = SQLQuery
myAdapter.SelectCommand = myCommand
Dim myData As MySqlDataReader
myData = myCommand.ExecuteReader()
If myData.HasRows Then
'and I don't know show the result :/
End If
and if you don't understand this affair, i tell it with a sample:
First user writes his e-mail and presses Enter. And his name and surname will show in a label. Like "Forget Password"
(I'll use it with My.Settings)
Hoping you would help,Thanks,
Emircan
-
Oct 11th, 2013, 08:39 AM
#7
Re: VB.NET | Finding Name with Email?
You don't know how to use a WHERE clause and have apparently made no effort to find out.
http://www.bing.com/search?q=mysql+w...ZI&form=MOZSBR
Two seconds searching the web and you've got examples. If you're not prepared to make that much effort then you're not going to get very far.
As for showing the result, it really depends what you want. The easiest option is probably to populate a DataTable and bind that to a DataGridView. Follow the CodeBank link in my signature and check out my thread on Retrieving & Saving Data for the first part and the second part is a simple matter of setting the grid's DataSource property.
-
Oct 11th, 2013, 08:40 AM
#8
Re: VB.NET | Finding Name with Email?
I just read your last post more carefully. Obviously you don't want a grid. That CodeBank thread of mine that I directed you to also shows how to get data directly from a data reader.
-
Oct 11th, 2013, 08:58 AM
#9
Thread Starter
New Member
Re: VB.NET | Finding Name with Email?
Very thanks man! It works very well! Thanks for your tip.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|