I am trying to create a property for my UserControl that will allow me to work with data that the user selects. I have the property working correctly, in that it will drop down a list of data sources in the test project. I am working with the Northwind database in SQL. This is the code for my Property:
Dim _ds As System.Data.DataSet
<Category("Data")> _
Public Property DataSource() As System.Data.DataSet
Get
Return _ds
End Get
Set(ByVal value As System.Data.DataSet)
_ds = value
End Set
End Property
When I select an item in the list, I get this error:
Property value is not valid. Object of type System.Windows.Forms.BindingSource cannot be converted to System.Data.DataSet.
I tried changing the Property's type to System.Windows.Forms.Bindingsource, but that didn't work either. The Property wouldn't drop down and display the project data sources anymore.
I really appreciate anyone's help with this.
Thanks,
Sheryl