daviddoria 334 Posting Virtuoso Featured Poster

I have a program with about 20 forms, almost all of which use the data from a tables in a dataset (from a datasource I added to the project). So I have made a global variable in a module:

Public TTData As New TTDataSet

And a DataAdapter for each table (also global):

Public daEvent As New TTDataSet.EventTableAdapter

And then I just use it from the forms when it is needed, ie

Dim OldRow As TTDataSet.EventTableRow = TTData.EventTable.Rows(0)

This works fine (although is there a better way, ie without globals?)

On one of these forms I want to display some data in a DataGridView. If I just drag the datatable from the project datasources onto the form, it creates a DataSet, DataAdapter, and BindingSource on the form. This is now a SECOND copy of the data, because I already have it in a global variable. I'd have to either reload all of the globals after editing anything in the local copy in the datagridview, or do this a different way.

Did I make the problem clear? Does anyone have any suggestions?

Thanks,

Dave