Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

move through dataset and assign to form

Status
Not open for further replies.

696796

Programmer
Aug 3, 2004
218
GB
Hi, i am filling a dataset with the contents of a table based on an sql query (see below) If you can imagine, i have textboxes on the form, which i want to bind to the results inside the dataset. ie, the second column in tblCar is carNo, so i want the carNo to be displayed in txtCarNo. This goes on for all the columns.

I want to somewhat replicate how access forms work, so the user can use buttons to scroll through the record set. I am unsure on how this would work, do i need a for each loop? very unsure of syntax for this...

Code:
Public Sub selectRecords()
        Dim sql As String = "SELECT * FROM tblCar"
        Dim conn As OleDbConnection = carDba.getCn
        Dim da As OleDbDataAdapter = New OleDbDataAdapter(sql, conn)
        Dim ds As DataSet = New DataSet
        da.Fill(ds, "returnedCars")
End Sub

Please could you guys advise me on a) how to bind specific parts of data from the dataset to controls on my form, and b) how i can scroll through the recordset by using buttons i.e. one going previous and one next(even first and last would be good)

Any good tutorials out there, let me know...

Cheers, kind regards,

Alex
 
Before you get too deep into buttons and scrolling, you might want to talk to your users. I have never been a fan of the data scroller. And with the wide adaptation of google and other search tools, users are often familiar and comfortable with a search and list screen. Anyway, you may just want to chat with them first to make the app as easy for them to use as possible.

If you stick with the buttons and scrolling, check out the currency manager class.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top