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 ??
Parth48Asked:
Who is Participating?
 
DhaestConnect With a Mentor Commented:
Reading and Writing XML in C#
http://www.c-sharpcorner.com/uploadfile/mahesh/readwritexmltutmellli2111282005041517am/readwritexmltutmellli21.aspx

To make sure that you're sensitive data is protected, apply some kind of encryption

How to: Encrypt XML Elements with Asymmetric Keys
http://msdn.microsoft.com/en-us/library/ms229746.aspx

0
 
kswathiCommented:
0
 
PagodNaUtakCommented:
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");
0
 
PagodNaUtakCommented:
Better to use config file for your purpose. Here is the sample:

 http://www.codeproject.com/KB/cs/customconfig.aspx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.