Accessing field values by fieldname using OracleDataReader?

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
rakgol_a
Posts: 13
Joined: Wed 17 Oct 2007 13:10

Accessing field values by fieldname using OracleDataReader?

Post by rakgol_a » Wed 03 Sep 2008 14:35

Hi,
Is there a way of accessing field values when iterating through OracleDataReader result without referencing fields by their
index instead to use fieldname.

Delphi has
x := dataset1.FieldByName('Field1').AsString;

What's the equivalent?

Regards.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 05 Sep 2008 07:31

Code: Select all

x = reader.GetString(reader.GetOrdinal("Field1"));

Post Reply