data binding

G

Guest

With ASP, you looped through data and output it, record by record, to display
in a browser. This is programatic and forces you to write the looping.

With ASP.NET, you can specify data to bind to a control and the control
determines how to display it. This can be done declaratively or
programatically with most controls.

To illustrate the difference:

NON Data binding:

for(int i=0;i<myDataSet.Tables[0].Rows.Countl;i++)
{
//Assume you would use a table instead, but this is simple
Response.Write(ds.Tables[0].Rows["MyColumn"]);
Response.Write("\r\n");
}

Data binding

DataGrid1.DataSource = ds.Tables[0].DefaultView;
DataGrid1.DataBind();

--
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
474,291
Messages
2,571,455
Members
48,132
Latest member
KatlynC08

Latest Threads

Top