Anyone know of a simple WPF/Silverlight data access framework? - wpf

Does anyone know of a simple WPF or Silverlight framework which enables you to e.g. define some database tables in e.g. SQL Server compact database and then the framework automatically creates the Window classes etc. which allows a user to login and edit that data?
I'm not looking for a complicated MVVM pattern example, it can be hard coded, it should just save the developer the time of creating all the CRUD code and forms and authorization necessary for users to edit the data. The developer could define 10 database tables, run the code generation, and then be pretty much 80% finished with any simple database application he wanted to make.
All of that would be generic code so I would think some framework like this would exist or someone would be working on some open source project like this already.
Does anyone know of a framework or tool like this?

It's not Silverlight, but ASP.NET Dynamic Data sounds like it would do what you're asking. It provides a web-based front end for editing database tables.
I've used it for a small project and you can literally have it up and running with CRUD functionality within an hour.

maybe you should take a look at the Sculpture project. There might be something you are looking for.

Since you cannot have direct connection to a database server with Silverlight, you should look at a .NET data access framework using the regular .NET Framework thru a Web Service.

Related

ASP.NET MVC4 Query By Example Open Source Suggestions

We're currently building a new application and part of the functionality we want to include for users is the ability to build ad-hoc querys through the web UI for reporting purposes.
e.g. The user may select the Entity1 report.
They are then able to select the criteria through the UI
pseudo example:
((Entity1.Type = 'this' OR Entity1.Type = 'something else') AND Entity1.CreatedDate > '01-01'2012')
Does anyone know if there is a good solution available (open source or paid) as this seems like it might be a lot of work to implement a bespoke solution.
Further to this we are using Entity Framework v4.1 magical unicorn edition.
If you build a UI that gives results in a structured form (e.g. {entityType.property}{operation}{value}) then it should be fairly straightforward to dynamically build an expression for this.
I decided to use http://devtools.korzh.com/query-builder-aspnet/ as it has saved me a lot of development time.

Web database application architecture

There is a medium size database application that needs to be built featuring a web interface. The platform is asp.net 3.5 (asp.net mvc 2), sql server and ext.net 1.3.0. The tool is visual studio 2010.
I wonder, should I start with the database design and business logic and move on to the UI when I've a complete working draft/skeleton? Or should I build the database and BL step by step and bind them to the web UI as I progress?
Even more specifically, should I construct the whole BL functionality as a separate dll project and then have it referenced by the web application project? If so, what communication options do I have? web services, for example?
Last but not least, the web application requires a security mechanism (user accounts etc). Should I design and integrate it right from the start or can I add it when everything else is ready?
(I hope my question is clear enough. As far as I know, creating a dozen or more aspx pages as a means of building and testing the application functionality leads to all shorts of problems and dead ends while being extremely time consuming. What I seek is a way to separate the UI from everything else. Something like having a working prototype to show case to the customer and have the (ext.net) web UI built later as a completely separate step.)
Is there a particular reason why you are not planning on using .NET 4.0 and MVC 3? MVC 3 comes with the razor view engine, which produces much nicer and cleaner views. And if you use .NET 4.0 you can use the Entity Framework. The new Entity Framework 4.3 lets you use code first with migrations, which might be a good way to go in a project where you need to "explore" the requirements in collaboration with the customer. Using code first you build your model using POCO classes and let EF take care of the database schema. This is effective if you make lots of changes to your model, which it sound like you might want to. Check out this video for a good introduction to code first with migrations.

WPF + WCF + MVC + EF Web/Desktop Application

I am planning an application which will have a web based component and a desktop client component. Basically I am planning to create the web based component using ASP.NET MVC3 & Entity Framework as a normal data driven website, however I am also planning to create a desktop client that will extend the functionality of the website, this is new territory for me and I am somewhat confused. I know that the best way to create an application that needs to access a central database is using WCF, however I have not used WCF before but have heard that it easily integrated with Entity Framework.
So I know that what I want to do is certainly possible I am just looking for some guidance for how the seperate components of this application should glue together, etc should I be working with WCF and Entity Framework first? Or should I complete the web based componenet before working with WCF?
Thanks,
Alex.
There are lots of ways to do this and all these ways have different level of complexities. For example, you could just build your web-application using Entity Framework, in the same web-application you expose an OData service (WCF Data Service) which provides a RESTful service that your WPF app can use to access the database. This is fairly easy, since WCF Data Services work really nicely with Entity Framework. This is basically a two-minute job (if you are not doing anything fancy). Your WPF application then has basically the same type of access to the database as your web-application does. In it's default configuration the WCF Data Service simply exposes a EF ObjectContext and allows the same type of operations on it. I would recommond you try this out and see for yourself if it fits your requirements.
But, this approach is basically a shortcut to allow a desktop application access to your database. Which in most cases, is perfectly fine. If you do want to put some effort into it, you could model a service-layer which either uses a Entity Framework data source or a OData data source. From here on in, it's all about design patterns. Which comes at a cost; separation of layers is a hard thing to do, if you want to do it right. Given that the .NET world as somewhat changed to "get the job done", it's fine to put those bits together and get a running app in no time.
You should also consider that the MVVM in WPF and MVC in a web-application have fundamental differences; where a MVC app just pulls a "snapshot" out of a database, a WPF application might need more effort and asynchronous programming to feel natural.
I can provide you with some guidance for specific tasks, like how to decouple the WCF Data Service and Entity Framework, but from my experience, the overhead of "doing it right" is enormous. If you are comfortible without a service-layer you will have a lovely experience working with EF and OData.
It is better you start with the web component first integrated with wcf, you can use entity framework, but i would recommend using T-Sql itself if you have a data heavy DB and it gives you lot of options for performance.
I would recommend you build the application model using MVP pattern as it makes it easy to switch from a desktop to web application and also inline with your requirements of extending it.

Creating web forms from a database schema

I'm wondering if there are any applications, preferably freeware, that can take a database configuration, and, with as little hassle as possible, create web forms for inserting data easily.
I'm finding it hard to express exactly what it is I'm after. Maybe I can talk a bit about what I need.
I have a configuration database that, at least usually, contains "the truth" about the servers in our system. It contains stuff like zone names, hostnames, different configuration items, etc, over multiple tables. Right now we're using simple INSERTs directly when adding new servers or other stuff, handling the keys and IDs ourselves. The crux is, they don't want us to develop a simple web form thingy to handle this, instead they want a tool that can generate the web form thingy. Did that make sense?
I'm not sure if anything like this exists or is reliable, but, I thought that if anyone knew, it's this community. Thanks!
As many have already stated, it depends on what technology you're working with:
.Net 3.5 - Dynamic Data or Subsonic's Scaffolding control
.Net 2.0 - Subsonic's Scaffolding control
PHP - CakePHP
Ruby - Rail's Scaffolding component
"with as little hassle as possible"
have you checked things like PHP/MySQL Web Database Application Code Generator 10.02 ?
or phpmyedit ?
seems to me that what everybody else proposed so far requires a fair amount of coding...
Also, have a look at phprunner. It is not free, but looking at the screenshots, it seems to fit your requirements.
ASP.NET has Dynamic Data, that I think fits your description.
There's also SubSonic. Both are free and open source.
Tried Dynamic Data?
Besides ASP.NET dynamic data, you could also have a look at SubSonic
With PHP, if you have the ability to name the tables and columns as you see fit, you could try CakePHP framework, and specifically the scaffolding feature. With scaffolding turned on, the code will create CRUD forms from the schema for you.
Here's the link for learning about SubSonic & Scaffolding http://www.subsonicproject.com/web-forms-controls/the-scaffold/
, enjoy ;)
One more link from the SubSonic forums http://monk.thelonio.us/post/Scaffold-Enhancements-in-SubSonic-21.aspx
You can try Adminer Editor
Adminer Editor is both easy-to-use and user-friendly database editing tool written in PHP. It is suitable for common users, as it provides high-level data manipulation.

Dynamic data for winforms

i have played around with dynamic data website. is there something similar for winforms.
if there isn't anything out there for doing the same with winforms than the question would be why not? we have a massive ERP application that we want to migrate from AS400 to .Net
Winform application. my initial thoughts were to have all the maintenances be as simple as Dynamic Data Website project.
I would think that WPF would be a better starting point then WinForms, as it has support for style to say how item of data are displayed.
Dynamic Data makes it easy to edit your DB on the web. For desktop (and web) apps take a look at the new Microsoft LightSwitch:
http://msdn.microsoft.com/en-us/lightswitch/gg441300
LightSwitch doesn't use Windows Forms. Rather it creates a Silverlight App that can run both on the desktop and the web. Pretty cool.
Dynamic data is using the routing functionality of the MVC framework. In Windows forms we don't have this approach of fetching data with URLs from a server.
I am not sure how this model could fit into Windows forms.
I think it's pretty hard to create something like dynamic data for Windows Forms.
My biggest concern is here, once you created that Framework, how do you configure it? I mean if you want to change 1 form to be a bit different than the others :-)
I think its better to generate Forms for the various tables in the Database context, using a powerful Grid control from one of the big vendors. And then you can configure those.
Remember this is a different approach then the dynamic data one, where no code is generated before compile time
I think the reason you don't see something like this in winform applications is because it's much easier to store a HTML page inside a database and then display it on the screen formatted properly when using a web application because your browser knows how to format the HTML.
You would have to, stored in the database, know where each label and field would go on the form in some sort of co-ordinates fashion (or you could use a layout 3rd party control) but the amount of work that would take might be tedious to do properly.
The dynamic data website I worked on did not take input from the user. It only displayed different web pages to the user and allowed the admin person to easily make changes to the content. If you wanted a user to beable to save data then that would even be more complex because you have to worry about validation, required fields, etc.
If you have lots of users that need to see different information based on their access level then I would just suggest having a table in the database that tells the system whether or not they should see the field on the form. Then use a 3rd party layout panel to format the visible fields.
my 2 cents
As much as Dynamic Data looks simple and cheap enough to access a database it wouldn't work for an ERP system anyways. Business systems are more than moving data between database and the user interface, they require business rule actions when saving data and while retrieving the may require some massaging to ensure meaningful presentation of storage optimized data.
If you still like to pursue this option it would be very easy to create an application that is build on top of Entity Framework.
I'm not aware of a Dynamic-Data-alike, but (having written one before, years ago, for ASP) I don't actually think it would be that hard, particularly with WPF and its templating support.
Actually if you were really clever you could probably 'borrow' the backend from Dynamic Data, and just reimplement the UI as WPF.
Would make a fun little project actually.
Alternative answer: Use Microsoft Access. No really.
Alternative answer #2: So why not just use Dynamic Data then?

Resources