]> Visual Studio frustrations. 🌐:aligrant.com

Visual Studio frustrations.

Alastair Grant | Fri 10 Jan 2014

For a long time, I've been trying to find an elegant light-weight solution to rapidly build .NET applications. I want to be able to provision a database with a model and build a UI which can handle complex data-entry and workflow.

.NET seems to provide all this.

Entity Framework: Allows you to build complex data-models and generate a database for you, or import a database and build a model on it. Great way for rapidly getting the design of your system up and running - plus it's portable as standard .NET classes so easy to integrate with.

SQL Server Compact Edition: Is a portable runtime, a bit like SQLite, but for .NET. No need to install a permanently running SQL server (express or otherwise).

ASP Databinding: ASP.NET allows you to data-bind your objects to controls, and have fields that will give you the value when loaded for display, and when you change them on the UI, automatically update the object behind (e.g. your data model).

Lightswitch: Allows you to rapidly build user interfaces and application logic through a UI - potentially meaning laborious data-entry systems can be put together really quickly.

All sounds brilliant eh? The problem is, none of these really get there...
To do two-way (or "unbinding") in ASP.NET, you have to use simple flat objects. Which means, you cannot really use Entity Framework to have an extensive model. And you're especially screwed if you're doing one-to-many or many-to-many relationships. It just doesn't work, and as-far-as-I-can-tell, there is no reason why it couldn't.

So I've abandoned that for the time being, and tried the new version of Lightswitch. Looks promising, apart from it falls flat on it's face straight away as the Microsoft team responsible doesn't allow it to work with Entity Framework (despite all being .NET). You have to use a classic SQL system (express or otherwise) - something I can accept, but was then thwarted by a lack of a many-to-many relationship support. And the ability to have shared tables. e.g. you have a user information table that can be referenced by multiple different foreign keys (e.g. project creator, last updated by, interested parties). So if you have duplicate database objects, you have to duplicate up the tables and the data.

What I want: There are some great ideas here, they just don't hit the mark. I want to be able to fire up visual studio, design a data-model (e.g. EntityFramework) and connect it to a data-source of my choice (e.g. Compact Edition, or full-blown SQL, depending on my mood). Then drag or generate fields that I want to be on my UI whilst maintaining cohesion for my object trees. I don't even mind doing a bit of programming to connect it all up. What I don't want to have to do is manually assigning fields to properties and moving things backwards and forwards when that data is already there in a nice usable form. Too much to ask? Apparently.

Breaking from the voyeuristic norms of the Internet, any comments can be made in private by contacting me.