Reputation: 66
In visual studio designer at design time I'd like to set DataSource property of BindingSource to a Dataset that is located in a different project. Looks like designer limits choices of DataSource only to the current project, Is there a way to override that behavior?
Upvotes: 0
Views: 2199
Reputation: 53593
You can use the 'Data Source Configuration Wizard' to set the DataSource property of a BindingSource to a DataSet in another project.
Add the project that the DataSet is defined in as a reference in your project where your BindingSource is. Select to 'Add a Project Data Source' in your BindingSource's DataSource property and on the 'Data Source Configuration Wizard' select Object and click click Next. On the next screen of the Wizard you'll see a namespace representation of the assemblies in your project. You should be able to drill down to your DataSet from here.
If you don't see it, be sure you rebuild your solution and try again.
Upvotes: 2
Reputation: 12874
The other project needs to be a dll. If it is than declare that DataSet public and add the namespace of that DataSet to your file after adding reference to that project.
Upvotes: 0