Results 1 to 3 of 3

Thread: [RESOLVED] VB2008: Move First, Last, etc..

  1. #1

    Thread Starter
    Fanatic Member louvelle's Avatar
    Join Date
    Jun 2008
    Posts
    513

    Resolved [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

  2. #2

    Thread Starter
    Fanatic Member louvelle's Avatar
    Join Date
    Jun 2008
    Posts
    513

    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

  3. #3
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: [RESOLVED] VB2008: Move First, Last, etc..

    Quote Originally Posted by louvelle View Post
    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
  •  



Click Here to Expand Forum to Full Width