Bug in the DataList Adapter

Last post 05-27-2006 9:57 PM by Russ Helfand. 6 replies.

Sort Posts:

  • Bug in the DataList Adapter

    05-04-2006, 7:20 AM
    • Member
      5 point Member
    • Ari@n
    • Member since 12-06-2005, 8:43 PM
    • Posts 1

    When you don't specify the RepeatColumns property of the DataList-control. The following error occurs:

    System.DivideByZeroException

    Row156: int nRow = iItem / dataList.RepeatColumns;

    in the class: App_Code\Adapters\DataListAdapter.cs  

    When you set the RepeatColumns to 1 everything works fine.

     

  • Re: Bug in the DataList Adapter

    05-04-2006, 9:23 AM
    • Contributor
      3,298 point Contributor
    • Russ Helfand
    • Member since 09-14-2005, 2:22 PM
    • Groovybits.com
    • Posts 741

    Nice catch!  I'll add it to my to-do list for the next rev.

    -Russ-

    Russ Helfand
    Groovybits.com
  • Re: Bug in the DataList Adapter

    05-06-2006, 1:43 PM
    • Member
      107 point Member
    • jlerman
    • Member since 06-24-2002, 12:46 PM
    • Posts 22
    • ASPInsiders
    ahh  good thing I searched before I added this again! Of course I didn't search to solve it - duh -but it was easy enough to find. :-)
  • Re: Bug in the DataList Adapter

    05-27-2006, 2:54 AM
    • Contributor
      2,898 point Contributor
    • jminond
    • Member since 07-21-2003, 6:33 PM
    • New York
    • Posts 608

    i dont think setting to 1 is the proper solution... becuase thats not really the "real" value... i think it's more appropriate to check if repepat column = 0... then not do any of that work in the first place.

     

    Jonathan Minond
    http://www.Jonavi.com
    http://www.jonavi.com/Default.aspx?pageID=21
    http://RainbowBeta.com
    http://community.rainbowportal.net/blogs/jonathans_rainbow_blog/default.aspx
    http://dotnetslackers.com/community/blogs/jminond/default.aspx
  • Re: Bug in the DataList Adapter

    05-27-2006, 5:09 AM
    • Contributor
      3,298 point Contributor
    • Russ Helfand
    • Member since 09-14-2005, 2:22 PM
    • Groovybits.com
    • Posts 741
    Agreed.  The real solution, which will be in the next rev of the kit, uses a more sophisticated heuristic to deal with cases where the repeat column count is 0.  Setting the value to a positive integer is just a simple workaround for the present rev of the kit (in cases where you can identify a reasonable number for the repeat column count).
    Russ Helfand
    Groovybits.com
  • Re: Bug in the DataList Adapter

    05-27-2006, 10:52 AM
    • Contributor
      2,898 point Contributor
    • jminond
    • Member since 07-21-2003, 6:33 PM
    • New York
    • Posts 608

    Cool, I think the solution I posted in the oher thread for having a bool to say if you have data....

    i imagine the same type of error could potentially ahppen with rows if someone where to modify the code a little, i dont know... in any case...

    if you have no data... you can hit a nodata template, or something like that.

     

    Jonathan Minond
    http://www.Jonavi.com
    http://www.jonavi.com/Default.aspx?pageID=21
    http://RainbowBeta.com
    http://community.rainbowportal.net/blogs/jonathans_rainbow_blog/default.aspx
    http://dotnetslackers.com/community/blogs/jminond/default.aspx
  • Re: Bug in the DataList Adapter

    05-27-2006, 9:57 PM
    • Contributor
      3,298 point Contributor
    • Russ Helfand
    • Member since 09-14-2005, 2:22 PM
    • Groovybits.com
    • Posts 741
    Please refer to this thread, http://forums.asp.net/thread/1298405.aspx, for more information.
    Russ Helfand
    Groovybits.com
Page 1 of 1 (7 items)