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

A

Andreas Klemt

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

Thanks for any answer!
Andreas
 
C

Cowboy \(Gregory A. Beamer\)

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!
**********************************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top