What is Page.DataBind doing? For what is this useful?

  • Thread starter Thread starter Andreas Klemt
  • Start date Start date
A

Andreas Klemt

Hello,
for what is Page.DataBind useful and what is it doing?

Thanks for any answer!
Andreas
 
The methodology in ADO was to loop through data and write it out to the
stream. In ADO.NET, you bind data instead of looping. Both Windows Forms and
ASP.NET have data aware controls that can be bound to. For each control that
can be bound to, there is a DataBind method. For example, a DataGrid:

DataGrid1.DataSource = MyDataSet.Table["MyTable"].DefaultView;
DataGrid1.DataBind();

If you have a lot of controls, rather than bind each individually, you can
use Page.DataBind(). This tells the rendering engine to find all controls
with a DataSource and bind them.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
Back
Top