Search code examples
.netvisual-studiodatasetdesignerbindingsource

assign dataset from different project as a datasource to bindingsource


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?


Solution

  • 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.