Design Error: Cannot bind to the property or column "Column Name" on the DataSource. Parameter name: dataMember
The following error occurs during design in Visual Studio. Although The binding works fine at runtime.
Its a problem because I am unable to see the form in visual studio, Just the "To prevent possible data loss...."
this is the binding placed in the _Load event
this.LastNameLabel.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.employeeBindingSource, "LastName"));
Am I doing something wrong here?
I must mention again the binding does work fine during runtime.
I know the load event will not run in design.
The error is a problem in design because it prevents me from working within the User Control. The User control design are is replaced with a red boarder and the error is displayed.
So I can't do anything in designer.
I added true to the end, still throws an error on designer.
Once again debug and run works fine.
Do you have a property or column named "LastName" at design time ? Do you create your DataSource at runtime but use the property name or column name of the DataSource at design time?
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Both the datasource and the binding were created in design. I override them during the _load
The label, binding and column all exist during design.
I am getting a handful of errors similar to this over the last couple days.
I am using Visual Studio 2010 beta. I starting to wonder if that is the problem.
Thank you for you input.
- Proposed as answer by antoinemekary Friday, April 08, 2011 6:34 PM