Hi Ian,
>Hi all,
>
>I have a web service that receives a table from a mobile app. I then am looking to loop through the incoming records and update or add the records as required. I try this following code and figured it should work and be a bit of a shorter route than a field by field replacement into the SQL Server. However, this code does not add a record into the SQL Server even though there are no errors and it returns a result of rulespassed. Any one have any ideas on why it is not working:
>
> MOBWORKORDREntity inEntity = new MOBWORKORDREntity();
> inEntity.SetDataRow(dtUpdWork.Rows[lnRowCnt]);
> oWork.GetMobWorkOrdersByPK(inEntity.PKMOBWORKORDR);
> oWork.CreateEntityList();
> if (oWork.EntityList.Count == 0)
> oWork.EntityList.Add(inEntity);
> else
> oWork.Entity = inEntity;
> mmSaveDataResult Result = oWork.SaveEntityList();
>
>dtUpdWork is the table passed back and has an identical structure to the table in the SQL Server.
>Any assistance would be appreciated. Thanks.
>Ian
Is your web service an MM DataAccess web service or a mm DataAccess WCF service or a standard Web Service?
Where is this code you are showing located?
Have you stepped through this code to verify the values in InRowCnt, inEntity.P{KMOBWORKORDR?
Does oWork.EntityList.Count evaluate to 0?
I am a littel intrigued by your second line of code where you are calling SetDataRow. What is the intent here? Does the following line actually give you a value in inEntity.PKMOBWORKORDR?
Tim
Timothy Bryan