Title: Generate XML from Dataset                                 If you need copy same format use firefox or chrome or safari but iexplorer not work


Preview of Code
protected void generateXML_Click(object sender, EventArgs e)
        {
            // Define Connection with connection string
            SqlConnection con = new SqlConnection("Add ConnectionString");
            // write query to retrieve data.
            SqlCommand cmd = new SqlCommand("select * from DetailMaster", con);
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet ds = new DataSet();   // Take Dataset
            da.Fill(ds);
            ds.WriteXml("D:/textXML.xml");  // Path to create XML
        }