Search code examples
.netwinformsdatasetcontrols

.net control for visual dataset manipulation


The question is quite simple, the answer may not be. Basically, in my application I've got a dataset in memory. This dataset has some dataTables and some dataRelations. I would like to allow an end-user to ADD a datatable that is the result of a query. The user should also be able to specify one (or maybe more) relation between his datatable and the default ones. He should not be able to delete or modify the original dataset.

This is an image showing how the control should work: Dataset editor

The ability to delete/modify relations or delete/modify a datatable in a visual way is not required. A wizard, like the one below, is enough: Datatable editor
(source: devart.com)

Relation editor

The images come from this page: http://www.devart.com/dotconnect/mysql/docs/DataSetEditor.html

Create my own control from scratch is surely not trivial, so I'm looking for something that's ready to use (or easy to modify). If you have ever used the Visual Studio DataSet Designer you should understand what I'm looking for. In fact, I would like a control similar to the DataSet Designer, but with the ability to "lock" some datatables and datarelations and with the ability to add an editable datatable based on a query result.

Ask for more information if it's not clear enough. Thank you.

EDIT: of course, the default dataset is not the result of a query. In this case, I could allow the end-user to edit the original query adding join, union or so on. The dataset I provide is the result of an elaboration, so it "lives" only in memory. Maybe, I could save this in a temp table inside the db. Anyway, before explore this solutions it would be better to have a visual tool instead of a query editor...

EDIT2: surfing the web I found this SQL tool: http://www.atlantis-interactive.co.uk/products/schemasurf/default.aspx. What I'm looking for is similar, but should be a WinForm control. It should accept any type of dataset, not only SQL.


Solution

  • It seems there's not such a control available on the web. I've created my own editor, most in textual way. For tables descriptions I used a TreeList. The same I've done for the relations descriptions. I haven't used any special editor for SQL. For now, I just checked that the text starts with "SELECT ".

    To transform any IEnumerable in DataTable I've taken a look at MoreLINQ.