Apple Introduces new iPhone 3G Tips: Disable AutoRun/AutoPlay on Pen-drive
Sep 05
VN:F [1.6.7_924]
Rating: 0.0/7 (0 votes cast)

If you ever tried or try to bind an Repeater control with a data source that have a period or dot in its one/more data item’s name then you might receive a error while binding the property using DataBinder.Eval method.

For Example, I was trying to do a simple thing with Asp Repeater control (which is bind to a DataTable). Please see the following piece of code


<%# DataBinder.Eval(Container.DataItem, “alt.price”)%>

Here is a column name “alt.price” in the data source (DataTable) . But the above line was resulting an error as follows

DataBinding: ‘System.Data.DataRowView’ does not contain a property with the name ‘alt’

To resolve this issue I used a new Method ‘DataBinder.GetPropertyValue’ that simply retrieves property value without any evaluation on the expression while DataBinder.Eval method uses reflection to parse and evaluate a data-binding expression against an object at run-time.

Conclusion – If you don’t want that the expression to be evaluated at the run time, it’s a good practice to use GetProtperyValue method instead of Eval method.





Share and Enjoy:
  • Twitter
  • Digg
  • del.icio.us
  • StumbleUpon
  • Google Bookmarks
  • Technorati
  • Facebook
  • DotNetKicks
  • E-mail this story to a friend!
  • Print this article!

4 Responses to “Error: DataBinding System.Data.DataRowView does not contain a property with the name …”

  1. V S Karthik says:

    I want to know the solution for the above error.

    UN:F [1.6.7_924]
    Rating: 0.0/5 (0 votes cast)
  2. Austin Higgs says:

    THANK YOU – this was bugging me for about 2 hours !!!!!

    UN:F [1.6.7_924]
    Rating: 0.0/5 (0 votes cast)
  3. Hello, just wanted you to know I have added your blog to my Google bookmarks because of your fantastic blog layout (LOL). But honestly, I believe your site has one of the cleanest design I’ve came across. It honestly makes your blog post easier to read.

    UN:F [1.6.7_924]
    Rating: 0.0/5 (0 votes cast)
  4. Bret Shure says:

    Hi,just observed your Blog when i google something and wonder what webhosting do you use for your website,the speed is more faster than my wordpress, i really need it.will back to check it out,thanks!

    UN:F [1.6.7_924]
    Rating: 0.0/5 (0 votes cast)

Leave a Reply

preload preload preload