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.comwww.prenia.comWeblog: blogs.prenia.com/cathi