Ben Chase (04/20/2007)
This looks like an instantiation order problem. Most likely, the BBS's BusinessObject property is not being set within the InitializeComponent of the UserControl before the Binding is added to the textbox's DataBindings collection. There's not a way to force the textbox to wait until the BO has been set to add the binding. You can, however, create an inherited BusinessBindingSource and in it's constructor add an instance of the business object that you need. The business object would be contained within the BBS, so that might cause some problems if you want to handle BO events on the user control (you would just have to add the handlers manually...). Another option would be to copy the designer code for the creation of the bindings and move the code out off the .designer.* file and into the constructor of your user control after InitializeComponent() is called. This would force the textboxes to wait until the BusinessObject has been set before binding to the BBS.That fixed it. Thank you. However, when I try to run my app I now get a "User Authentication" screen asking for a username and password. I'm haven't experimented with any role based security yet and I'm using windows authentication for sql server. What password is this asking for?