Invoke Code C# question

Hi,
I am trying to use Invoke C# code like below. The code is printing First Name okay, but not printing column Index. No error is shown. Can you suggest what I am missing. Thanks a lot,

For Each row As Datarow In In_dt.AsEnumerable
Console.WriteLine(row(“First Name”))
Console.WriteLine(In_dt.Rows.IndexOf(row))
Next

Hi,

Your code seems VB, right?
Anyway, ToString is necessary in WriteLine as the following. Can you try this?

For Each row As Datarow In In_dt.AsEnumerable
Console.WriteLine(row("First Name"))
Console.WriteLine(In_dt.Rows.IndexOf(row).ToString)
Next

Regards,

Thanks @Yoichi

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.