henrykorir
henrykorir

Reputation: 117

VB.Net TableAdapter versus BindingSource in Database

I fail to understand the roles of TableAdapters and BindingSource in VB.NET database handling. It seems to me they perform the same operation. I have read every piece of information from MSDN to each an every Q&A online but I can't seem to differentiate their roles. When and when not to use TableAdapters or BindingSource? It will be more comprehensive if one can give a solution with examples.

Upvotes: 1

Views: 4122

Answers (1)

William Xifaras
William Xifaras

Reputation: 5312

They are different things.

A TableAdapter basically maps data from a database table into a DataSet.

A TableAdapter component fills a dataset with data from the database, based on one or more queries or stored procedures that you specify. TableAdapters can also perform adds, updates, and deletes on the database to persist changes that you make to the dataset. You can also issue global commands that are unrelated to any specific table.

A BindingSource is a .NET component which can be used for Data Binding for a control to a datasource like a DataSet.

The BindingSource component is designed to simplify the process of binding controls to an underlying data source. The BindingSource component acts as both a conduit and a data source for other controls to bind to. It provides an abstraction of your form's data connection while passing through commands to the underlying list of data. Additionally, you can add data directly to it, so that the component itself functions as a data source.

Database To Typed-DataSet, With BindingSource Example

A Detailed Data Binding Tutorial Example

Upvotes: 1

Related Questions