in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Error When Calling getxxxxxRows() in a DataLibrary

Last post 03-05-2008 4:05 PM by MarkBonafe. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-05-2008 3:57 PM

    Error When Calling getxxxxxRows() in a DataLibrary

    I am using Visual Studio 2008.  I have create a DataLibrary with three DataSets (Menu, MenuGroup, and MenuItem).  Each row in Menu has linked items in MenuGroup.  The problem is that when I call .GetMENU_GROUPRows() I get a "Value does not fall within the expected range" error.

     Here is a snippet of code:

    dsMenu.Fill();   // ds is a C1WebDataSet
    C1.Data.
    C1DataTable ds = dsMenu.Tables["MENU"];
    for (int i = 0; i < ds.Rows.Count; i++ )
    {
         MENURow mrow = MENURow.Obj(ds.Rows[i]);
         C1WebMenu1.Items.Add(
    new C1WebMenuItem(mrow.Title));
         MENU_GROUPRow[] grow = mrow.GetMENU_GROUPRows();   // Error here: "Value does not fall within the expected range"

     I have absolutley no idea why this error happens.  Can you help?

    Thanks

    Mark

  • 03-05-2008 4:05 PM In reply to

    Re: Error When Calling getxxxxxRows() in a DataLibrary

    Ok I've figured this one out.

    I originally had only the Menu table in the dataset.  When I added then MenuGroup table the call works perfectly.  Although I'm not sure why the method GetMENU_GROUPRRows() was created in the first place.

    So lesson learned:  If you are going to use a dataset and you are going to ask for rows from a related table, make sure the related table is in the dataset - just being in the Schema is not good enough.

    Mark

Page 1 of 1 (2 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.