C# .NET - generate xmls in different paths based on the dataset row value

Asked By samaira samaira
03-Feb-12 07:49 AM
if((string)dtr["SourceSystem"]=="Client")
{
using (XmlTextWriter writer = new XmlTextWriter(@"C:\ModeIntegration\Inputs\Output_client.xml", null)
{
//code
}}
else if(if((string)dtr["SourceSystem"]=="Source"))
using (XmlTextWriter writer = new XmlTextWriter(@"C:\ModeIntegration\Inputs\Output_source.xml", null)
{
//code
}
  Danasegarane Arunachalam replied to samaira samaira
03-Feb-12 10:26 PM
Hope this help


string sFileName="C:\ModeIntegration\Inputs\Output_{0}.xml";
string strcondition="";
if((string)dtr["SourceSystem"]=="Client")
{
 strcondition="Client";
}
else if(if((string)dtr["SourceSystem"]=="Source"))
 strcondition="Source";
}
 
using (XmlTextWriter writer = new XmlTextWriter(@String.Format(sFileName,strcondition), null)
{
//code
}
Create New Account
help
Visio document store in xml format in C# application. Dears I want to store the visio document in .XML extension. I already used .VDX. But now i want .XML format. In my reviews, VDX is stored in XML format. If it means surely it saved as XML. I tried many ways. But ? Please send answers or code snippets in c#. XmlTextWriter writer
Xml transform to Another Xml .NET Framework Hi I have to convert one xml format to new xml format. Here I have giving one example. Old format of Xml . . . . . . . . . . . . . New Format of Xml . . . . . . . . . . . . . Only difference are in old and new format of xml: 1
Function to read / write Custom XML Format Hi, I'm new in XML and I need to have a VB.net or C# function to read and write the following xml format, i try to write using the standard xml formatting but can't output the format i need. Please help, Thank You! <Configuration> <Key Name = "Title"> <Key Name = "MyApp"> <Value Name False< / Value> < / Key> < / Key> < / Configuration> Hi Just take this sample how to read and write XML file using C#. http: / / www.c-sharpcorner.com / UploadFile / mahesh / ReadWriteXMLTutMellli2111282005041517AM / ReadWriteXMLTutMellli21.aspx thank you
Write XML file from XML reader Hi, Iam haven some problems writing XML file from XML reader. Bascially I send request in XML and then receive response back in XML format and then I read XML stream. I want to beable to write this file to the server. Dim d As
convert rtf file to xml format or some other format which could be easily be converted to xml? end of post Here's an rtf to xml converter http: / / rtf2fo.com / Hi, This is sample only To transform custom XML into RTF either saved to a file or copied to the Clipboard Create a Visual following at the top of the code window before the Form1 Class implementation: Imports System.Xml Imports System.Xml.Xsl Imports System.IO Add the following code to the Form1 Class implementation (before End