views:

23

answers:

1

Not sure if this makes sense but:

I have a form with a number of TableAdapters attached (bound in VS).

Depending on user selection, a DataTable is filled by one of the TableAdapters and passed to another form for display/Edit in a DataGridView. How do I then persist any changes to the DataTable back to the database?

I need to identify which TableAdapter to use so that I can call the Update method on it but I can't see an easy way of doing this.

I have a horrible feeling that I've coded myself into a corner here....

+1  A: 

I think there is definitely some design issues here but it sounds like they have already been coded. Why don't you tuck a reference to the TableAdapter into the Tag property of the DataTable and then when you are ready you can cast back to it? Just off the top of my head.

Mike Cheel
Practical, I like it! Thanks.
Simon