Using SQL in Visual Studio to Edit XML Output



Continuing with this project, I'd like to edit the data generated from



var results = _Service.GetUserReportResults("login", criteria.ToArray(),
grouping, SortFields.ToArray(), userReport.UserReportId,userReport.EntityModel, key);


before using the XMLSerializer. The file created gives output such as



<UserReportPreviewListDto>
<ExtensionData />
<Id>previewReportFieldsId</Id>
<Field0>-7</Field0>
<Field1>L</Field1>
<Field2>Lab Work Complete</Field2>
<Field3>False</Field3>
<Field4>LabWorkComplete</Field4>
<Field6>False</Field6>
</UserReportPreviewListDto>

<UserReportPreviewListDto>
<ExtensionData />
<Id>previewReportFieldsId</Id>
<Field0>-6</Field0>
<Field1>S</Field1>
<Field2>Sent to Lab</Field2>
<Field3>False</Field3>
<Field4>SentToLab</Field4>
<Field6>False</Field6>


but some of the values in the various Fields need to be changed from verbatim values to related numerical values. For example, LabworkComplete in Field4 of the first record needs to be changed to 2, and SentToLab in the second record needs to be changed to 7.


The Field Values have their corresponding numerical values all set up in the database, I just...don't know the best way to query the database to change the data before its output to the xml file.


Like always, I apologize if I'm not altogether clear with what I'm trying to say here. If there's any further information I can provide, or any alternative routes to be suggested, any help at all is always appreciated.


No comments:

Post a Comment