views:

31

answers:

1

My program has two forms which get data from the same data source.

After binding controls to tables and fields on both forms, I noticed each form has it's own apparently duplicate DataSet.

Is it standard practice for each form to have its own DataSet even though they use the same ConnectionString and connect to the same database at the same time?

A: 

The dataset each form uses will be its own instance, to have each form using the same instance you would need to place you data behind a singleton, and bind the forms to the appropriate properties in the Singleton.

As for your question, his behaviour is fairly standard practice on the framework, unless told otherwise the framework will create new instances of entities, and should those entities perform actions such as loading data from a database, will execute those queries independantly for each instance.

squirrel