none
LINQ Update Problem RRS feed

  • Question

  • Hi All, I am using LINQ in my application . While updating data i am getting below problem..

     " GenericArguments[2], System.Int32 , on System.Data.Linq.Mapping.PropertyAccessor+Accessor`3[T,V,V2] violates the constraint of type V2 "

     Here is my code
    ServiceOfferedPosting == CLASS 

    ServiceOfferedPosting objAcc = GetServiceOfferedPostingByID(Convert.ToInt32(str[k]));
     if
     (objAcc != null
    )
     {
     objAcc.IsBlocked = blnIsBlock;
    objAcc.LastUpdateDate = DateTime.Now;
    using
     (FarmlinkDataContext dc = conn.GetContext())
    {
     dc.ServiceOfferedPosting.Attach(objAcc, true
    );
     dc.SubmitChanges();
    }
     }
    
    


     the same thing i am doing for other classes and it is working fine.. but for this class it is giving error..
    Please tell me why this error is coming ?

    Thanks..

     Nitin
    • Moved by edhickey Tuesday, May 5, 2009 6:15 PM More appropriate Forum (From:ASMX Web Services and XML Serialization)
    Wednesday, April 22, 2009 7:25 AM

All replies

  • Sorry I didn't see your question before - I would have moved it to the correct forum, because this certainly is not the right one. Please say what sort of LINQ you are using, so I can move the question to the appropriate forum.
    John Saunders
    Use File->New Project to create Web Service Projects
    Use WCF for All New Web Service Development, instead of old ASMX or obsolete WSE
    Sunday, May 3, 2009 1:05 AM
  • Can you show the definition of ServiceOfferingPosting and GetServiceOfferedPostingByID ?

    Thanks,

    [)amien
    Wednesday, May 6, 2009 3:34 PM
    Moderator