komsky
komsky

Reputation: 1588

Data binding to control Error

I'm using Visual Studio Ultimate 2012 RC on Windows 7 Pro to desing simple WPF 4.5 App with SQL CE 4.0 I've modeled database to entities and this works perfectly, but when I try to drag and drop an entity property from Data Source window Visual Studio generates known error:

Binding Data to Control
Cannot add the control to the design surface or bind to the control because the type cannot be resolved. Please try to build the project or add necessary assembly references.

Well, I've of course tried to clean and rebuild solution. Some answers suggested that I should move my project to C:\ drive, so I did moved my project to C:\ drive. I even tried to create a whole new project on C:\ drive with SQL CE database. I tried to change target framework from 4.5 to 4.0 because I can do this operation in my Visual Studio 2010 without problems, but this also didn't help. I can't generate Entities in VS2010 because my VS2010 doesn't connect with SQL CE 4.0 :(

Can it be a VS2012 bug or I am missing something? Thank you for any replies!

Upvotes: 4

Views: 3608

Answers (2)

YourFriend
YourFriend

Reputation: 434

Had the same issue, I Rebuild my project by going to Build Menu and it solved my problem

Upvotes: 0

komsky
komsky

Reputation: 1588

OK, this is strange, but helps. If you encounter such a situation you have to manually add XML namespace to your own project - something like this:

<Window ....
       xmlns:yourAlias="clr-namespace:WpfApplication1"
 ... />

Then clean up your project and recomplie. After a while visual drag-drop from data sources begins to work like magic :)

Upvotes: 4

Related Questions