Link to home
Start Free TrialLog in
Avatar of introlux
introluxFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Creating a CSV or XML file

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
ASKER CERTIFIED SOLUTION
Avatar of vsudip
vsudip
Flag of India 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
SOLUTION
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
Avatar of introlux

ASKER

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???
Any idiea guys?