|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Question on Dataset navigation vb.netway to code a form so that a user could navigate through a dataset ie: MoveFirst, MoveNext, MovePrevious, MoveLast, Update and Delete records and have an option to find a record. I have been able to figure out how to navigate both using bound and unbound controls. But I can't figure out how to do the Navigation and find a record at the same time. Do most people use one connection, dataAdapter, Dataset for browsing a table and then if a user wishes to Search for a unique record do you close the first dataset and open another using a sql string like "SELECT * FROM datatable WHERE PK = ?" What has me confused with that idea is if a user found a record using the some type of (search) dataset routine, how do I set up the program so that the user can just click MoveNext again and movenext or moveprev from that record that he/she just was viewing? Thanks Newbie You have asked a question that has a really big answer if someone tries to
explain it. But in short... VB retrieves all of the records you ask for in one go, so there is no question of movewhatever. Use the Row property of the DataTable in your DataSet and set the Index number of your ROw to access individual rowdata. this a collection, so it's gonna be easy. Here's a sample codett that retrieves all the rows from the datatable Dim dRow as datarow for each drow in mydatatable.rows console.writeline drow.item("myfield") next Cyril Newbie,
The currencymanager is for what you ask. Have a look at this simple sample. http://www.vb-tips.com/default.aspx?ID=c6c7d9a8-7511-41a1-a488-2e91e5295e7c I hope this helps, Cor Cor,
It's amazing how much .Net has. I didn't know that CurrencyManager existed. It sounds like a pretty interesting thing. Thanks Cyril Thanks for the info guy's, I guess I should not have made the question
so broad, what I should have asked is would it be better to use unbound controls vs bound controls. I can see using bound controls will be faster in development but you lose control with what you can do. In the above question I am looking at creating a form with text box's that display fields from a dataset. I wanted to give a user the ability to navigate through the dataset using MoveFirst, MoveNext buttons but also offer a search option. I will look into the CurrencyManager for more ideas Thanks Newbie
How do I schedule events for execution ?
How to check datatable.select How do menu list with one check ShellExecute in VB2005 How to minimize to system tray ? VS 2003 looping through datareader Custom Property array of interface? Using SP_Password with VB.NET but keep getting "old (current) password incorrect for user" LIKE operator question |
|||||||||||||||||||||||