CSharpTest.Net
GetString(Int32) Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Data Namespace > CsvReader Class > GetString Method : GetString(Int32) Method

i

Glossary Item Box

Gets the string value of the specified field.

Syntax

Visual Basic (Declaration) 
Public Overloads Function GetString( _
   ByVal i As Integer _
) As String
C# 
public string GetString( 
   int i
)

Parameters

i

Example

Library/Library.Test/TestCsvReader.cs

C#Copy Code
using (CsvReader r = new CsvReader(new StringReader(CSV_DOC1)))
{
    r.Read();
    Assert.AreEqual("1a", r["f1"]);
    Assert.AreEqual("1b", r[1]);
    Assert.AreEqual("1c", r.GetString(2));
    Assert.AreEqual("1c", r.GetValues()[2]);
}
VB.NETCopy Code
Using r As New CsvReader(New StringReader(CSV_DOC1))
    r.Read()
    Assert.AreEqual("1a", r("f1"))
    Assert.AreEqual("1b", r(1))
    Assert.AreEqual("1c", r.GetString(2))
    Assert.AreEqual("1c", r.GetValues()(2))
End Using

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys