Have you always wanted to be able to update a dataset in a batch, or fill its contents from a database with just one command? I have... in a project 10 months ago, I thought about it, but I had then never heard about Reflection.
After reading, profiling, factoring and refactoring.. reading again... I'm beginning to understand that Reflection allow us to do every thing...
With this tool, you will be able to fill or update a whole dataset with two lines of code...
I decided to write this when making searching for a tool which could enable something like this... I discovered the mocosh tool which seemed really useful. I didn't test it, but I understood from the screenshot that generated classes should be quite easy to combine...
This tool is a tracking tool for ASP.NET. I wanted to do batch updates every hour on the database to minimize calls to it. It doesn't assume any transactions (currently).
Also, as I wrote this for my project, I made every test specifically for my database schema.
Encapsulates a dataset and permits automating the work between the database and the dataset.
Contains some useful methods to work with Reflection.
How to use it
- Create your database.
- Create your
DataSet in Design mode by drag & dropping a table on this to ensure the creation of table adaptors. In fact, you have to do this to ensure the naming conventions of TableAdapters generated by CSC are followed. If you want to work in a different way... I propose extending
DataSetValidator and overriding the
GetAdapter method (see the remarks in the class).
- Declare your
DataSet in your application as usual.
- Add a reference of DataDigest.Datas.Helper in your project, or copy the classes in it.
- Instantiate the
DataSetAdapter for your
DataSet as you would with a TableAdapter for a
= new DataSetAdaptor<typedDataSet>(dataSet);
- After this is done, you'll want to download data from the database and fill in the dataset:
- Later, when you want to update the database....
I know that using generics in this case is not useful, but I think this tool has a future. It may be useful to recover the typed encapsulated dataset without casting.
Use this for non-critical applications. Datasets are only useful for these kinds of application in my opinion. For good maintenance, I have only one word... NHibernate.
Sorry about my poor English.
- 06-11-22: Handles exceptions at filling and saving time. Warning: there is no transactions support.