datatable get specific column from row

duxfox--

I have the following:

//a datatable with some rows and columns lets say 5x5
var datatable = new DataTable(); 
var numberofrows = datatable.rows.count;

for (int i = 0; i < numberofrows; i++) {
 //for each row, get the 3rd column
 var cell = datatable.rows[i].???
}

how do I get the 3rd column for each row?

Yogee

for 3rd column

var cellValue = datatable.Rows[i][2];

better, if you know the column name,

var cellValue = datatable.Rows[i]["column_name"];

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to get a specific column value from a DataTable in c#

From Dev

Add a row under specific column in datatable

From Dev

Sum up a column from a specific row down

From Dev

Attempting to retrieve specific column from first row

From Dev

Get Values from DataTable by row and column name

From Dev

LINQ to remove duplicate rows from a datatable based on the value of a specific row

From Dev

Get Selected Row From DataTable in Shiny App

From Dev

How to get one specific column from datatable into model in MVC Razor

From Dev

QML TableView get data from specific cell (selected row + specific column)

From Dev

How to get specific column and row value from multiple text files?

From Dev

Scroll to specific row in DataTable

From Dev

How to prevent row click function on specific column in datatable?

From Dev

Set value of each DataTable row in specific column

From Dev

Get specific column from the last inserted row with PDO

From Dev

Remove a specific value from each row of a column

From Dev

Remove row from datatable if column is not numeric

From Dev

Get specific value from table with table name, row and column index

From Dev

ECHO specific row from specific column

From Dev

Delete a specific row from datatable

From Dev

Looping through a specific column from a datatable

From Dev

Randomly selecting a row for a specific column from CSV

From Dev

LINQ to remove duplicate rows from a datatable based on the value of a specific row

From Dev

Datatable function for specific column

From Dev

C# - How can i get header row from datatable and arrange it vertically down a column?

From Dev

Get specific column foreach row in DataTable

From Dev

Get the value of a specific row and specific column from datagrid

From Dev

Get specific column header names from DataTable

From Dev

Get a specific value from a specific column from specific row?

From Dev

How to get row's column value from datatable to textbox after double click on datagridview row without using properties

Related Related

  1. 1

    How to get a specific column value from a DataTable in c#

  2. 2

    Add a row under specific column in datatable

  3. 3

    Sum up a column from a specific row down

  4. 4

    Attempting to retrieve specific column from first row

  5. 5

    Get Values from DataTable by row and column name

  6. 6

    LINQ to remove duplicate rows from a datatable based on the value of a specific row

  7. 7

    Get Selected Row From DataTable in Shiny App

  8. 8

    How to get one specific column from datatable into model in MVC Razor

  9. 9

    QML TableView get data from specific cell (selected row + specific column)

  10. 10

    How to get specific column and row value from multiple text files?

  11. 11

    Scroll to specific row in DataTable

  12. 12

    How to prevent row click function on specific column in datatable?

  13. 13

    Set value of each DataTable row in specific column

  14. 14

    Get specific column from the last inserted row with PDO

  15. 15

    Remove a specific value from each row of a column

  16. 16

    Remove row from datatable if column is not numeric

  17. 17

    Get specific value from table with table name, row and column index

  18. 18

    ECHO specific row from specific column

  19. 19

    Delete a specific row from datatable

  20. 20

    Looping through a specific column from a datatable

  21. 21

    Randomly selecting a row for a specific column from CSV

  22. 22

    LINQ to remove duplicate rows from a datatable based on the value of a specific row

  23. 23

    Datatable function for specific column

  24. 24

    C# - How can i get header row from datatable and arrange it vertically down a column?

  25. 25

    Get specific column foreach row in DataTable

  26. 26

    Get the value of a specific row and specific column from datagrid

  27. 27

    Get specific column header names from DataTable

  28. 28

    Get a specific value from a specific column from specific row?

  29. 29

    How to get row's column value from datatable to textbox after double click on datagridview row without using properties

HotTag

Archive