Solved

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

Posted on 2011-02-10
4
487 Views
Last Modified: 2012-05-11
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 ??
0
Comment
Question by:Parth48
  • 2
4 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
ID: 34868645
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
 
LVL 6

Expert Comment

by:kswathi
ID: 34868646
0
 
LVL 8

Expert Comment

by:PagodNaUtak
ID: 34868691
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
 
LVL 8

Expert Comment

by:PagodNaUtak
ID: 34868695
Better to use config file for your purpose. Here is the sample:

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now