Solved

Creating a CSV or XML file

Posted on 2008-06-25
4
335 Views
Last Modified: 2013-11-26
Hi,

I have an ASP.NET application, where I have to read some values from a DB and write the resultset to an CSV or XML File.

Reading the data from the DB is not problem.  However, I'm not sure on how to create the CSV or XML File.

Can I please have some sample code (C#) on how to create the File, and write the values. Also, I need the file to be saved

Basically for example:
user goes on web site. Enters the following data:

Name: [txtName]
Email Address: [txteaddress]

Once user has entered the following data, user clicks on the Submit button which actions the following tasks.

1. insert new data into access database file (which is ok, i have working)
2. send an e-mail of acknowledgement (which is ok, i have working)
3. create and enter question label and user data input in the text boxes into relevant cells in a .csv or .xml file (im having difficulty doing)

Thanks in advance......

introlux
0
Comment
Question by:introlux
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
vsudip earned 250 total points
ID: 21863918
0
 
LVL 3

Assisted Solution

by:ofkr
ofkr earned 250 total points
ID: 21863938
0
 

Author Comment

by:introlux
ID: 21864057
I have looked at the examples and the 1st example and this is exporting from a datagrid and not from taking the values entered from user input (text boxes).

Second one, not sure how it works. Try to use code to compile but does not work.

Any working examples out there???
0
 

Author Comment

by:introlux
ID: 21874069
Any idiea guys?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

867 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

21 Experts available now in Live!

Get 1:1 Help Now