Here is the code sample provided in .Net Sdk:
Private Sub ReadOrderData(ByVal connectionString As String)
Dim queryString As String = _
"SELECT OrderID, CustomerID FROM dbo.Orders;"
Using connection As New SqlConnection(connectionString)
Dim command As New SqlCommand(queryString, connection)
connection.Open()
Dim reader As SqlDataReader = command.ExecuteReader()
' Call Read before accessing data.
While reader.Read()
Console.WriteLine(String.Format("{0}, {1}", _
reader(0), reader(1)))
End While
' Call Close when done reading.
reader.Close()
End Using
End Sub
My question: Is that this reader(0) actually the shortcut for calling this property reader.item(0)?
reader(0)refers to the very first field in the retrieved row. However you better reference field by name,OrderIDin this case.Take a look at SqlDataReader.Item Property.
This is indexed property. You can find some details here.