Using Data Binding with ASP.NET Mobile Controls
ASP.NET mobile controls enable Web applications to easily interface with databases. This technique is called data binding. Data binding takes advantage of the power of Microsoft ADO.NET DataSet and DataTable objects. These objects enable mobile Web pages to connect to databases.
A DataSet object represents a set of data that includes data tables as well as the relationships between them. Controls on the page can bind to a specific field in a DataTable object, which is how ASP.NET mobile controls enable users to display and manipulate data.
The mobile Web page framework provides a flexible means of binding controls to information in a data store. To perform data binding programmatically, applications invoke the DataBind method of a control that is bound to the data. You can also configure data binding at design time in Visual Studio.
Mobile Web pages enable applications to perform both simple and complex data binding. Simple data binding enables applications to bind a control property to a single value in a database. Complex data binding involves connecting a control to a set of values, such as a column in a DataTable object. For instance, applications often use data binding to populate List controls with items that the user can select.
Unlike ASP.NET Web controls, data binding for mobile Web pages does not use data source controls such as the SqlDataSource control and the corresponding DataSourceID property in bound controls. Instead, you set the DataSource property of a control either declaratively or in code, and then call the DataBind method.
For more information, see the links listed in the following table.
Describes binding to a DataTable object, which represents one table of in-memory data. DataTable objects can be created and used independently, or can be used by other Microsoft .NET Framework objects, most commonly as a member of a DataSet object.
Performs binding between a server control property and a data source.
Renders multiple data fields for each item in the object list.
Describes creating DataSet objects, relations, and constraints, and populating them with data.
Before an application can access data in a database, it needs to create a connection to the database and to configure a data adapter. For information about common data adapter properties, see DataAdapter. For details about adding data sources and adapters to your project, see Data Adapter Configuration Wizard.
The following table lists commonly user properties of data-bound controls:
In addition, the ObjectList control supports the properties listed in the following table: