samythehunk 0 Newbie Poster

this is a part of my code.
can anyone help to write database tables to xml format without usingbuiltin function in .net (i.e xmltextwriter and writexml)

private void WriteDataSetToXmlFile(DataSet ds, string fileName)
{
    if (ds != null)
    {
        string b = TextBox2.Text;

        string absoluteFileName = Server.MapPath(fileName);
        System.IO.FileStream myFileStream = new System.IO.FileStream("D:\\XMLCON\\XMLCON\\" +b.ToString() +".xml", System.IO.FileMode.Create);
        System.Xml.XmlTextWriter myXmlWriter = new System.Xml.XmlTextWriter(myFileStream, System.Text.Encoding.Unicode);
        ds.WriteXml(myXmlWriter);
        myXmlWriter.Close();

    }
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.