|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Dataset requeryIn VB6 I used a method requery to repopulate a recordset. I don't find an equivalent for the .NET dataset. I don't update my datasets at all, but I use them to navigate through subsets of my tables, saying my dataset contains primary keys, ordered in a specific way. When I go the next, previous, first or last record in the dataset I execute a select stored procedure. When I do an insert, delete or update I call a stored procedure, implying I should do a requery of the dataset (subset) because a row might be deleted or inserted in the database, while it's not reflected in the disconnected dataset. Of course I can execute the query to create the dataset again, after each insert/delete. I wondered there might be a method dataset.requery or a workaround to achieve this easily?? Thanks a lot, Kind regards, Perre Van Wilrijk. I would requery as normal, and merge the result into the original dataset.
If you use a date modified column in your data, you could query where last modified is greater than the date that you last polled for changes. Show quoteHide quote "Peter Van Wilrijk" <p**@koopjeskrant.be> wrote in message news:A_oDf.220358$4n4.7293024@phobos.telenet-ops.be... > Hi, > > In VB6 I used a method requery to repopulate a recordset. I don't find an > equivalent for the .NET dataset. > > I don't update my datasets at all, but I use them to navigate through > subsets of my tables, saying my dataset contains primary keys, ordered in > a specific way. When I go the next, previous, first or last record in the > dataset I execute a select stored procedure. When I do an insert, delete > or update I call a stored procedure, implying I should do a requery of the > dataset (subset) because a row might be deleted or inserted in the > database, while it's not reflected in the disconnected dataset. > > Of course I can execute the query to create the dataset again, after each > insert/delete. I wondered there might be a method dataset.requery or a > workaround to achieve this easily?? > > Thanks a lot, > Kind regards, > Perre Van Wilrijk. Thanks AMDRIT,
Do you have a link to an example? I deduct merging 2 datasets (with the same structure) is easily done ... as using a "union" in SQL? Can't I get a problem with this workaround if a row was physically deleted, the row will stay in the dataset I guess ... but there I see now I always have to check that since another user might have deleted the row that I have in my susbset of primary keys. However, I wondered whether the dataset stores the query it was originally build on. This way I don't have to store that query (and it's values in the where clause) myself. Actually that's what I meant to ask, but I didn't make myself very clear. Sorry, no native English and just switching from VB6 to VB.NET. Kind regards, Perre Van Wilrijk. AMDRIT wrote: Show quoteHide quote > I would requery as normal, and merge the result into the original dataset. > If you use a date modified column in your data, you could query where last > modified is greater than the date that you last polled for changes. > > > "Peter Van Wilrijk" <p**@koopjeskrant.be> wrote in message > news:A_oDf.220358$4n4.7293024@phobos.telenet-ops.be... > >>Hi, >> >>In VB6 I used a method requery to repopulate a recordset. I don't find an >>equivalent for the .NET dataset. >> >>I don't update my datasets at all, but I use them to navigate through >>subsets of my tables, saying my dataset contains primary keys, ordered in >>a specific way. When I go the next, previous, first or last record in the >>dataset I execute a select stored procedure. When I do an insert, delete >>or update I call a stored procedure, implying I should do a requery of the >>dataset (subset) because a row might be deleted or inserted in the >>database, while it's not reflected in the disconnected dataset. >> >>Of course I can execute the query to create the dataset again, after each >>insert/delete. I wondered there might be a method dataset.requery or a >>workaround to achieve this easily?? >> >>Thanks a lot, >>Kind regards, >>Perre Van Wilrijk.
It's the little things
Windows forms application change value of textbox in datagrid Cancel a thread - please help Permutation listing Tell to ASP.Net don't watch some web folders multiple tcp connections extracting part of a graphic in a PictureBox to the clipboard Problem while referencing the multiple projects in same solution. Search Directories |
|||||||||||||||||||||||