Binding columns

  • Thread starter Thread starter tshad
  • Start date Start date
T

tshad

Is there any difference between:

<asp:Label id="Label3" runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.employeeid") %>'>
</asp:Label>

And

<asp:BoundColumn DataField="Answer"
HeaderText="Answer"></asp:BoundColumn>

or is this just a matter of style?

Thanks,

Tom.
 
yes.

the first case for each row in the dataset, DataBinder.Eval is called which
parses the expression and uses reflection to determine the value.

the second case for each row in the dataset, it looks up the value for the
specified column.

the second case is faster.

-- bruce (sqlwork.com)
 
bruce barker said:
yes.

the first case for each row in the dataset, DataBinder.Eval is called
which
parses the expression and uses reflection to determine the value.

the second case for each row in the dataset, it looks up the value for the
specified column.

the second case is faster.

I am setting up column templates for my Datagrid to handle adding new rows
to my tables. Can I use the BoundColumn in my TemplateColumns? At the
moment I am using the first case with DataBinder.Eval.

Thanks,

Tom.
 
Back
Top