CSV Reports
CsvStringToDataTable Method
Example 



KellermanSoftware.CsvReports Namespace > CsvReader Class : CsvStringToDataTable Method
A CSV String
Read a CSV string into a DataTable. There must be a header row and the column names must be alpha numeric.
Syntax
Public Function CsvStringToDataTable( _
   ByVal csvString As String _
) As DataTable
Dim instance As CsvReader
Dim csvString As String
Dim value As DataTable
 
value = instance.CsvStringToDataTable(csvString)
public DataTable CsvStringToDataTable( 
   string csvString
)
public:
DataTable^ CsvStringToDataTable( 
   String^ csvString
) 

Parameters

csvString
A CSV String
Example
CsvReader csvReader = new CsvReader(); //Trial Mode
//CsvReader csvReader = new CsvReader("place user name here", "place license key here"); //License Mode            
 
string csvString = "FirstName,LastName\r\nJohn,Smith";
 
DataTable results = csvReader.CsvStringToDataTable(csvString);
Dim csvReader As New CsvReader() 'Trial Mode
'Dim csvReader As New CsvReader("place user name here", "place license key here") 'License Mode            
 
Dim csvString As String = "FirstName,LastName" & vbCrLf & "John,Smith"
 
Dim results As DataTable = csvReader.CsvStringToDataTable(csvString)
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

CsvReader Class
CsvReader Members