StrataFrame Forum

DataSourceKey error within User Control

http://forum.strataframe.net/Topic7712.aspx

By Tim Dol - 3/26/2007

I have created a User Control that basically displays data on an Infragistics Grid control using a BusinessBindingSource.  I added a line of code to fill the business object.

When I drag this control onto a form I get an error. (See Attached Doc). I'm not sure if I'm doing something wrong as I can fill the same business object on a normal form without any problems.

Thanks,

Tim

By Trent L. Taylor - 3/26/2007

Yes, you are not testing for design-time.  Your fill method is either in the New or the Load and since you are at design-time you do not have a connection string (or DAL) defined.  Be sure and use an event such as the Load rather than the New because the design-time indicator may not yet be set in some cases.

If Not Me.DesignMode Then
  '-- Fill your BO
End If