I am redoing a legacy VB.Net app in MVC. Part of the app used MSXML2 to create an XML document. I am having trouble with two elements so far. The legacy code uses "Right" (Right Function in C#?) and "Format" (Equivalent of Format of VB in C#) commands.
Is there a preferred method for creating the XML other than using System.XML?
objNode = objDoc.CreateNode("element", "Payout", "");
objElement = objDoc.DocumentElement.AppendChild(objNode);
objElement.SetAttribute("companyNumber", Right(objRs.Fields["operating_unit_code"].Value, 3));
objElement.SetAttribute("employeeNumber", objRs.Fields["employee_code"].Value);
objElement.SetAttribute("earningsCode", objRs.Fields["incentive_type_code"].Value);
objElement.SetAttribute("chargeToProject", Right(objRs.Fields["operating_unit_code"].Value, 3) & objRs.Fields["organization_code"].Value);
objElement.SetAttribute("amount", Format(objRs.Fields["sum_calc_amount"].Value, "#.00"));
objElement.SetAttribute("weekEndingDate", Format(objRs.Fields["pay_period_end_date"].Value, "MM/DD/YYYY"));
objElement.SetAttribute("employeeName", objRs.Fields["full_name"].Value);