Dave,
That's the problem. You are setting the data source to
"this.dsfrmRestock_ProductSelect1", and then getting the BindingContext for
the "Product" member in "this.dsfrmRestock_ProductSelect1". Your call
really needs to be:
bmProduct = this.BindingContext[dsfrmRestock_ProductSelect1];
That will give you the appropriate binding context.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Dave" <Da**@discussions.microsoft.comwrote in message
news:82**********************************@microsof t.com...
>
Sorry, I didn't state that the error is on last line below.
BindingManagerBase bmProduct
bmProduct = this.BindingContext[dsfrmRestock_ProductSelect1, "Product"];
this.cmbProduct.DataSource = this.dsfrmRestock_ProductSelect1;
this.cmbProduct.DisplayMember = "frmRestock_ProductsSelectCommand.Name";
this.cmbProduct.ValueMember = "frmRestock_ProductsSelectCommand.Barcode";
bmProduct = this.BindingContext[dsfrmRestock_ProductSelect1, "Product"];