//Make database connection SqlConnection conn = new SqlConnection("Data Source=localhost;Initial Catalog=Dashboard;Integrated Security=True"); string cmd = "select EmployeeNo,Name,Email from mySymphony"; SqlDataAdapter da = new SqlDataAdapter(cmd, conn); DataSet ds = new DataSet(); ds.Locale = System.Globalization.CultureInfo.CurrentCulture; da.Fill(ds); // Get a StreamWriter object StreamWriter xmlDoc = new StreamWriter(@"D:\\Mahantesh.Net\ALLWebconceptsamples\ds.xml", false); // Apply the WriteXml method to write an XML document ds.WriteXml(xmlDoc); xmlDoc.Close(); Response.Redirect(@"..\\ALLWebconceptsamples\ds.xml");