I\'m rewriting/converting some VB-Code:
Dim dt As New System.Data.DataTable()
Dim dr As System.Data.DataRow = dt.NewRow()
Dim item = dr.Item(\"myItem\")
Try like this:
var item = dr["myItem"];
In C# you can access the indexer property directly. And the DataRow.Item property is defined as indexer.
There is actually no "Item" property in C#. In VB the DataRow cell access is defined like this:
Default Public Property Item (
column As DataColumn
) As Object
So there is a literal "Item" property. However, in C# it is defined like this:
public object this[
DataColumn column
] { get; set; }
So this is the default property of the class / object. So you access it with the object name.