C# WinForms & SQL bindings
- by vent
I have a MSSQL database with many tables and relations. I want to bind it to my C# GUI application with text- and combo-boxes. Which one is the best way to do it:
(1) Everything done manually by own classes and methods: Import data to dataset or to many datatables separately, then create dictionaries to comboboxes, manually retrieve data to textboxes and create a sql statement if update action will be invoked, or,
(2) Done automatically by VS: Connect my controls with BindingSource and BindingNavigator if needed.
I know how to deal with the first one, but if the second way would be better, my question is — how to achieve it? I haven't dealt with automatically created databindings and I don't know how to tell to DataBinding property (Key|Value|Text) about relations and current row's ID. And what is the method to cancel/update changes in all GUI elements?
I need a simple solution for this scenario. It's a quick-and-dirty academical project, which must only "work" and be as fast implemented as it can.
Thanks