[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.
:)
Re: VB2008: Move First, Last, etc..
I found the answer...
:)
Code:
http://www.vbforums.com/showthread.php?t=214649&highlight=vb.net+movenext
Re: [RESOLVED] VB2008: Move First, Last, etc..
Quote:
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.