none
How to keep relation as order in DataSet pass through from web service RRS feed

  • Question

  • I have a client/web service system and would like get DataSet with relation from web service side.

    The Client side calls webmethod something like this,

    webReference.WebMethod( string parm1, int parm2, ref DataSet ds);

    Inside web method, we will add three relation, FK_Branch, FK_Log, FK_Employee. I can see they are in same order with DataSet.Relation.Add statement from web side.

    However, we got DataSet.Relation in different order from Client side. The order in Client side is FK_Employee, FK_Log, FK_Branch. I don't know why the order of relation in DataSet is changed. Does anyone can help me find out why and the solution to fix this problem?

    Thanks for you help,
    Friday, March 7, 2008 4:18 PM

Answers

  • Create a copy of all the DataRelations, clear the DataRelations collection, and then recreate it in the order that you need. That should work, and it while it may have some performance impact, it shouldn't be too bad. Let me know if it works.

     

    Thanks,

    Erick

    Monday, March 10, 2008 4:02 PM

All replies

  • Why are you relying on the order of the DataRelation objects?  That does not seem like a wise thing to do.

    Friday, March 7, 2008 11:42 PM
  • Is there a reason that you need to rely on a particular order for the relations?

     

    In general, there are no assurances on the order of additions for any of the objects over a web service call.

     

    Thanks,

    Erick

    Sunday, March 9, 2008 9:07 PM
  • Currently, we are using Infragistic grid control displaying a Parent/Child relation grid. That is why we add relation in dataset. However, the infragistic grid control diaplay the tree grid based on relation order.

    For example,

    I would like the result display like this.

    Order
    |___ItemDetail
    |___Log
    |___ShippingInfo


    I have to put relation order as FK_ItemDetail, FK_Log, FK_ShippingInfo. Otherwise, the UI will display different order. If the order of relation can't be passed to Client side, I need find out another way to implement it.

    Thanks

    Monday, March 10, 2008 3:25 PM
  • Create a copy of all the DataRelations, clear the DataRelations collection, and then recreate it in the order that you need. That should work, and it while it may have some performance impact, it shouldn't be too bad. Let me know if it works.

     

    Thanks,

    Erick

    Monday, March 10, 2008 4:02 PM
  • Thanks for your replay. That is what I am doing now. I thought web service can pass dataset with ordered relations to client. However it doesn't.
    Monday, March 10, 2008 7:02 PM