Cannot get sum of the specific column's values

Hello guys,

I’m trying to get sum of the values of specific columns. I have no problem with one line named columns. For Example;

I can use this code for sum: myData.AsEnumerable.Sum(Function(x) Convert.ToDouble(x(“Program”).ToString.Replace(",",".")) ).ToString

But when i try for two line named for this code i got this error;

I tried column name as;
“Net”+vbLf+“Tutar (TL)”
“Net”+Environment.Newline+“Tutar (TL)”

But it did not work. How can i solve this? Thank you

column shouldnt contains the new line just change the column name and try

But i used vbLf in filter data table and it worked


just try to debus and check the output how its looking like after read from sheet, then you can get. may be even any white space there error will occur

try using column index, if your column positions are fixed, like here the required column index is =10 , so try x.Item(10)
as suggested by Raj , before using this linq query check rename the column using

dt.columns("Net"+vbLf+"Tutar (TL)").columnname="Net Tutar (TL)"

then use the linq query ,
once done rename the column back to normal

i got this error after column name change

Hello @Oguzhan_Celik

Please print the value in a message box and check whether the Column name is valid.
Make sure there are no unwanted spaces and symbols.