0

I want to retrieve data from two row of a data table.

Suppose I have three columns.

Column 1      Column 2    column 3
1              14          16
2              15          17

I want to retrieve data from row 1 and row 2 so that I can add data as (15 +16)

Siddharth Srivastva
  • 965
  • 2
  • 13
  • 34
Harry
  • 1
  • 1
  • Show what you have already done. – arqam Feb 09 '18 at 06:47
  • Check out >[this](https://stackoverflow.com/questions/9412466/how-to-select-data-from-datatable#9412532) – Marco Sadowski Feb 09 '18 at 06:52
  • `Dim sum = datatable.AsEnumerable().Take(2).Select(row => row.Field(Of Integer)("Column1) + row.Field(Of Integer)("Column2) + row.Field(Of Integer)("Column3)).DefaultIfEmpty(0).Sum()` – Fabio Feb 09 '18 at 07:54
  • When you say data table, do you mean System.Data.DataTable or a table in a database? If your data is still in a database you need to let us know which one. – Mary Feb 09 '18 at 09:51
  • I am using access database. I mean access database. – Harry Feb 09 '18 at 12:31

0 Answers0