Wednesday, 3 December 2014

Referencing SQL Tables in Visual Studio to Edit XML Output Values



Continuing with this project, I've run into a new situation that I haven't been able to find particularly relevant help with on here so far.


The XML file we're producing is giving us a synopsis of a report created by the client, but some of the values set in-browser to create the report (for example, "Inactive") are returning numerical values established through a transformation step on their end ("Inactive" would be "4", in this case), and the XML is returning the number, rather than the verbatim value, and I have to reference the databases through SQL to basically reverse this.


Here's where it gets particularly challenging for me.



  1. Each record returned in the XML document has its values broken down by Field (Field0, Field1, etc).

  2. Where Field4 may be "HiredDate" in the new employee report, it may be "FavoriteSandwich" in a different report.


So the SQL I need to use will have to reference a combination of the Report name and list of possible values per Field to determine whether that 3 in Field4 should be changed to "HiredDate" or "FavoriteSandwich".


I'm using two different tables right now, with a Join that I think may be called for this...but I'm not sure if that's the right course of action or not. The idea is to use the ID from the table that uniquely identifies each Report/Field combination in conjunction with the table that identifies all possible values for each Field.


I suspect I'm doing a rather poor job at describing this. I apologize for that. A lot of what I'm doing with this right now is spitballing, and all new territory for me, personally. If anything needs to be or can be clarified, please let me know. Any help at all would be greatly appreciated.


Thank you!


No comments:

Post a Comment