|
-
Aug 9th, 2011, 10:57 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] VB2008: Move First, Last, etc..
Hey guys!..
I'm having a difficulty in finding the right code for this. I'm not using the OLEDB.Adapter or the built-in binding navigator for this.
Code:
Dim commandText = "SELECT * FROM tblReservation"
Dim con As New SqlConnection("Data Source=GAMER-6\SQLEXPRESS;Initial Catalog=HotelReservation;Integrated Security=True")
Dim command As New SqlCommand(commandText, con)
con.Open()
Dim reader As SqlDataReader = command.ExecuteReader
While reader.Read
txtFirstName.Text = reader("FirstName").ToString()
txtLastName.Text = reader("LastName").ToString()
End While
This is my code in getting the value in the database. But it shows only the last record and not the specific row that I want to show. I just want to create a button with a movenext, moveprevious, movefirst and movelast on my form.
Hope I can get help and gain a little knowledge in you guys because I'm only a beginner at VB.Net.
Manny Pacquiao once posted in his twitter:
It doesn't matter if the grammar is wrong, what matter is that you get the message
-
Aug 9th, 2011, 11:26 AM
#2
Thread Starter
Fanatic Member
Re: VB2008: Move First, Last, etc..
I found the answer...

Code:
http://www.vbforums.com/showthread.php?t=214649&highlight=vb.net+movenext
Manny Pacquiao once posted in his twitter:
It doesn't matter if the grammar is wrong, what matter is that you get the message
-
Aug 9th, 2011, 11:31 AM
#3
Re: [RESOLVED] VB2008: Move First, Last, etc..
 Originally Posted by louvelle
I'm not using ... the built-in binding navigator for this.
Why? Even if you don't display the UI portion of it, you can still use its functionality.
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
|