Link to home
Start Free TrialLog in
Avatar of Parth48
Parth48Flag for India

asked on

how can i create xml file in my C#.net win application and then read data from that ??

i want to create xml file in my C#.net window application and store sensitive data into it,
and then read it to get data,
but how can i do this ??
ASKER CERTIFIED SOLUTION
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Where will the infromation in xml comes from? if it is in the database then you can use dataset.

Sample code in creating and reading xml file using dataset:

 DataSet ds = new DataSet();

// This code creates the XML file.
ds.WriteXml("YourFileNameHere");

// This code reads the XML file.
ds.ReadXml("YourFileNameHere");
Better to use config file for your purpose. Here is the sample:

 http://www.codeproject.com/KB/cs/customconfig.aspx