0

I have a mysql database that I am using my Windows form application to view and fill data in.

I'm running into a problem when I try to use binding sources in a user control. All I'm doing is clicking and dragging a label from the data sources toolbar.

When I run the program, the label can't reference the fields in my database. The correct data sources are displayed at the bottom of the design view and in the Designer code.

But, when I do the same thing in the form, it works perfectly well.

What changes between the form data binding and the user control data binding? I've tried digging in the Designer code, creating an entirely new project so I don't have any messy code in the way.

Edit: The article, Walkthrough: Creating a Windows Form user control that supports simple data binding makes it look like I can simply drag an drop on the user control, no question asked. However, this does not work for me

  • Related? [Using a BindingSource in a UserControl](http://stackoverflow.com/questions/982376/using-a-bindingsource-in-a-usercontrol) – stuartd Jun 10 '16 at 17:24
  • I saw that thread while I was googling around, it really doesn't help me. I honestly need to do nothing more complicated than have a label display the value in a field of my database. I would prefer to just drag and drop and let the designer take care of it. What's really confusing me is that my program is working fine while I'm working inside the form, but once I add the user control into the mix, everything falls apart. I'm wondering if there is some sort of parent designation I need to go through. Like the DataSource isn't linked to the user control itself, it's linked to the form above? – Charlie Fallon Jun 10 '16 at 17:31

0 Answers0