Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Double entry forms
Message
 
À
23/07/2002 11:43:09
Ron Hodge
Sebrex Systems, Inc.
Dacula, Georgie, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00681712
Message ID:
00681771
Vues:
17
One approach you could take is create two SQLDataAdapters, one for each backend. You would use the same DataTable for both (assuming the table structure is identical). You would call the Update method of one DataAdapter, passing the DataTable and then call the second DataAdapter, passing the same DataTable. One thing you need to keep in mind though is you need to override the changing of the DataRow's RowState when the first update is occuring. If not, then no rows will be updated when the second DataAdpater's update is done.

You can trap for the DataAdapter's RowUpdated event and set
the Status property of the RowUpdatedEventArgs object to
SkipCurrentRow where appropriate. This will leave the DataRow's
RowState intact.
Private Sub RowUpdatedHandler(ByVal sender As Object, _
    ByVal e As SqlRowUpdatedEventArgs)

    e.Status = UpdateStatus.SkipCurrentRow

End Sub
Add the Handler to the first DataAdapter:
AddHandler da1.RowUpdated, AddressOf RowUpdatedHandler
Update the first DataAdapter, passing the DataTable. Then update the second DataAdapter passing the same DataTable. When the second DataAdapter is called, the AcceptChanges will be called, changing the RowState to UnChanged.



>Hi, all,
>
>I'm working on an vb.net app with a sql2000 database that will require double entry for a table and a copy of the table. In the FoxPro version I'm converting from, this was pretty straightforward, I just opened the dupe table as an alias and used the same form for both.
>
>What's the best way to use similar indirection on a dataset with bound controls to accomplish the same thing without doing two forms?
>
>Thanks.
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform