VB.NET Examples

ChilkatHOMEAndroid™Classic ASPCC++C#C# WinRTDelphi ActiveXDelphi DLLVisual FoxProJavaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerShellPythonRubySQL ServerUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET WinRTVBScript

VB.NET Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
FTP
HTML Conversion
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
PFX
RSA
S/MIME
SMTP
Socket
Spider
SSH
SSH Tunnel
SSH Key
SFTP
Tar Archive
Upload
XML
XMP
Zip Compression
Misc

More Examples...
Amazon S3
Email Object
DKIM / DomainKey
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

Byte Array
VB.NET FTPS
System.IO

 

 

 

 

 

 

(VB.NET) Create CSV File

Demonstrates how to create a new CSV file with some simple content.

Chilkat .NET Downloads

Chilkat .NET Assemblies

Chilkat for Mono

Chilkat for Xamarin

'  This sample code creates a new CSV file (sample.csv)
'  that contains this content:
' 
'  year,color,country,food
'  2001,red,France,cheese
'  2005,blue,"United States",hamburger

Dim csv As New Chilkat.Csv()

'  Indicate that the 1st row
'  should be treated as column names:
csv.HasColumnNames = true

csv.SetColumnName(0,"year")
csv.SetColumnName(1,"color")
csv.SetColumnName(2,"country")
csv.SetColumnName(3,"food")

csv.SetCell(0,0,"2001")
csv.SetCell(0,1,"red")
csv.SetCell(0,2,"France")
csv.SetCell(0,3,"cheese")

csv.SetCell(1,0,"2005")
csv.SetCell(1,1,"blue")
csv.SetCell(1,2,"United States")
csv.SetCell(1,3,"hamburger")

'  Write the CSV to a string and display:
Dim csvDoc As String
csvDoc = csv.SaveToString()
TextBox1.Text = TextBox1.Text & csvDoc & vbCrLf

Dim success As Boolean

'  Save the CSV to a file:
success = csv.SaveFile("out.csv")
If (success <> true) Then
    TextBox1.Text = TextBox1.Text & csv.LastErrorText & vbCrLf
End If


 

© 2000-2013 Chilkat Software, Inc. All Rights Reserved.