i have created a folder named xml. what i want to do is to create a test.xml file and write all data in stringbuilder sb to that test.xml file.
i am able to create the test.xml file at desired location but unable to write the value from sb to that file. below is my code
string filepath = Application.StartupPath;
filepath = filepath.Replace("\\bin\\Debug", "\\xml\\");
TextWriter tx = File.CreateText(filepath+"test.xml");
tx.Write(sb.ToString()); // sb is stringbuilder whic contain data
Textwriter
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Sunny SharmaRank #223 · 11.1K reputationPosted Apr 29, 2013, 11:14 PM EDT
nishant ranjanRank #4,961 · 317 reputationPosted Apr 29, 2013, 11:17 PM EDT
Sunny SharmaRank #223 · 11.1K reputationPosted Apr 29, 2013, 11:41 PM EDT
tx.Close();
Hope this helps!
Happy Coding :)
-Sunny