Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / General / June 2005

Tip: Looking for answers? Try searching our database.

databinder.eval

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ben R. - 27 Jun 2005 18:46 GMT
What's the purpose of this static method? I know the general idea, use
reflection to detect type of source object and extract the property or field,
but won't you always know the type of object you're binding against? When
would this be a mystery? Also, does it make a difference if you have the
first parameter as container.dataitem or just container and then have
dataitem.fieldname for the second parameter? How does it handle these two
situations?

Thanks...

-Ben
Teemu Keiski - 27 Jun 2005 19:00 GMT
Hello,

that's probably one corner-stone with the "DataBinder.Eval"-thinking that
you don't need to know the data source row type exactly so changing the data
source type for a reason or another would not require a change in the
databinding expressions as well. So it can help reducing effects of changes,
though it also brings performance cost. (one of those famous design
decisions :-) )

Sometimes it isn't that clear but for example if you bind to a DataReader
the type of the Container.DataItem is System.Data.Common.DBDataRecord, with
DataTable or DataView, it is System.Data.DataRowView. Or with a custom
collection it is of course type of the custom collection item. But if
developer really wants to, it isn't of course mystery (if you know how to
check the type).

If speaking of web forms, Container refers with a DataGrid to a DataGridItem
(DataList->DataListItem, Repeater->RepeaterItem) and DataItem is a property
of it.

Signature

Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.