DataReader: What is the "real" property of r("somecolumn")?

46 Views Asked by At

I am using a MySqlDataReader and a Sqlite.SqliteDatareader.

For both, I can access the value of a column like this:

    Do While r.Read
        dim sSomeString = r("SomeColumn")
    (...)

I think that r("SomeColumn") internally resolves to a specific function / property, for example r.Columns("SomeColumn").Value, but I did not find a property that would fit.

Can somebody tell me what this function / property is?

I hope somebody understands my question.

1

There are 1 best solutions below

0
On BEST ANSWER

It maps to the Item property:

Gets the value of a column in its native format.

so

Dim sSomeString As String = r("SomeColumn").ToString

is equivalent to

Dim sSomeString As String = r.Item("SomeColumn").ToString