Question

This may seem quite confusing and sorry for my bad english. So, while filling a datatable, you can fill it directly from datatable and update it with DataAdapter. So, what's the advantage of using a binding source if its just more coding? Does it have any other special purpose?

If possible, can you please explain with a example.

Thanks

Was it helpful?

Solution

I may be misunderstanding your question, but I'm not sure that setting up a binding source is really all that much more coding. The advantage that a binding source gives you is that it provides a way for the data source and the data target (for lack of a better term) to be notified when changes are made to the data on either side.

For example, let's you have a binding source set up to bind an ADO.NET datatable to fields on a Windows Form. If you update data on the form, the binding engine fires a notification and your datatable will get updated. It works the other way, too: fields on the form will be updated with changes made to the datatable.

If you don't have a binding source set up, you have to manually check for changes on either side and manually take care of keeping your data source and data targets in sync.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top