wasn't there a way to access a datatable with [][]

  • Thread starter Thread starter D
  • Start date Start date
D

D

I recall seeing some syntax regarding accessing data in a data table using
brackets like

using DataTable T

T[4][3] = "test";

Can someone post some sample.

Thanks
 
Almost. You have to say:

T.Rows[4][3], which will get you the value from the fourth column [3]
in the fifth row [4] of the table.
 
D,

The statement:

T[4][3] = "test";

Means that you are accessing the fifth row and then setting the fourth
column to the value "test".

The syntax that you have is legitimate.

Hope this helps.
 
If it's legitimate, then my C# compiler hates it.

DataTable has no default indexer. You need to say

T.Rows[4][3]
 
Back
Top