Hi!. i am doing a winform to add,modify and remove users from a mysql database. At form load i fill a dataset with all the users that are in the database, then i made a simple navigation system with 2 buttons (prev and next) and a textbox telling the number of record you are on. I also have a find button that opens a modal form which has a datagrid filled by a query. When you do dbclick to a cell the modal form returns the userId that you have select. After that i do this
dataset.tables("xxx").defaultview.sort="ID"
position=dataset.tables("xxx").defaultview.find(selectedID)
updatePosition(position)
this works great, but it fails if before searching you add or remove records. When adding a record i dont reload the dataset i only add the record to the database and the dataset this way.
obDataset.Tables("xxx").Rows.Add(obCartRow) ' here in the dataset
obCarteros.insertUser(obTemp) ' here in database by calling a store procedure.
the same for removing. if i reload the dataset before searching it works but i dont want to do that, i only want the position of the record.
Anybody can help me???.
thanks!!!!!
Pamela
dataset.tables("xxx").defaultview.sort="ID"
position=dataset.tables("xxx").defaultview.find(selectedID)
updatePosition(position)
this works great, but it fails if before searching you add or remove records. When adding a record i dont reload the dataset i only add the record to the database and the dataset this way.
obDataset.Tables("xxx").Rows.Add(obCartRow) ' here in the dataset
obCarteros.insertUser(obTemp) ' here in database by calling a store procedure.
the same for removing. if i reload the dataset before searching it works but i dont want to do that, i only want the position of the record.
Anybody can help me???.
thanks!!!!!
Pamela