 |
Overview
A CSV file is a way to collect data from your forms so that it can be conveyed as input to a table-oriented application. CSV files can also be opened with Microsoft Excel so that data is lined up in cells. CSV files can also be imported into most databases such as Microsoft Access and many more.
Description
The CSVAction property controls how Auto DB works with CSV files, and is set to
None (CSVActionType.None) by default. That means, that ASP.NET Auto DB will not create a CSV file (regardless of whether you have a name specified or not.)
The CSVAction property can also be set to:
- None (CSVActionType.None) – Do not create a CSV file.
- Store (CSVActionType.Store) – If you specify Store for the CSVAction, Auto DB will write your form data to a new or existing CSV file. The file(s) will not be emailed to you, but rather will continue capturing form data so you can import all form data into Microsoft Excel, Microsoft Access, or other applications that recognize the CSV format.
If you specify Store for the CSVAction and provide a valid CSVFileName, ASP.NET Auto DB will create the file if it does not exist and will append data to the file on all subsequent form submissions.
If you do not specify a CSVFileName, a new CSV file will be created for each form submission.
Please note that the directory
that CSV files are written to must provide the ASPNET account with
read/write/modify/delete rights.
Example of a CSV File Created by ASP.NET Auto DB
If you provide the name of a file that does not currently exist, ASP.NET Auto
DB will create the CSV File. If the file already exists, the Auto DB
control will append the file
with each form submission. An example CSV file created by the Auto DB control
is shown in Listing A.
Full_Name,Company,Website_Address,Email_Address,OptIn
John Doe,ACME Inc,http://www.acme.com,jdoe@acme.com,Yes
Jane Doe,WHAM Ltd,http://www.wham.com,jdoe@wham.com,Yes
Listing A
Usage
See Listing B for an example of the CSVAction property in the Auto DB
control tag.
<cc1:AutoDB id="AutoDB1"
runat="server"
CSVAction="Store"
CSVFileName="Data/NewsletterSubscriptions.csv"> </cc1:AutoDB>
Listing B
Related Properties
CSVFileName, CSVDelimiter,
CSVIncludeHeader
|
 |