Online Product Info
CSVDelimiter Property

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 CSVDelimiter property indicates which single character should be used to separate field values in your CSV file. The default is a comma, so a comma will be used if you do not specify another value. 

ASP.NET separates group field values (such as a checkboxlist) with commas. This can present a problem in a CSV file. For that reason, Auto DB will automatically remove any characters matching the CSVDelimiter from form values when they are written to CSV files.

Other common CSV Delimiters besides a comma (,) include:

  • Pipe Symbol |
  • Tilde ~

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. Notice how a comma is used as the delimiter for the field names and values in this file. 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 CSVDelimiter property in the Auto DB control tag.

<cc1:AutoDB id="AutoDB1" runat="server" CSVAction="Store" CSVFileName="Data/NewsletterSubscriptions.csv" CSVDelimiter=","> </cc1:AutoDB>
Listing B

Related Properties

CSVFileName, CSVAction, CSVIncludeHeader

 

© copyright 2004 360 IMPACT. All rights reserved.