Edit code LINQ?

Now I use LINQ as below.

DT_TextFile.AsEnumerable().ToList().ForEach(Sub(row) row("APFNME")= row("APFNME").ToString+"-"+row("APLNME").ToString)

I want to add another column for update

  1. Update Column FPP by calculate Column FPP /(divide) Column Case
  2. Update Column APSUM by calculate Column APSUM /(divide) Column Case

Please guide me about it.

Can​ help​me​ in​ this​ case?

Hi @fairymemay

sure ,

could you tell me what u meant by Column case here ?

@NIVED_NAMBIAR it​ mean​ column​ name​ = case?

image

@fairymemay

For updating the different columns, you had to use the code like this as below

DT_TextFile.AsEnumerable().ToList().ForEach(Sub(row) row("FPP")= CDbl(row("FPP").ToString)/Cdbl(row("Case").ToString))

DT_TextFile.AsEnumerable().ToList().ForEach(Sub(row) row("APSUM")= CDbl(row("APSUM").ToString)/Cdbl(row("Case").ToString))

Try this approach

Thanks & Regards,
Nived N

1 Like

@NIVED_NAMBIAR If I want to delete row(“APLNME”) by use LINQ same.

How to edit code?

Hi @fairymemay

Why you need to delete the column?

Have a look on the thread

Regards
Gokul

2 Likes

@Gokul001 From code as below.

DT_TextFile.AsEnumerable().ToList().ForEach(Sub(row) row("APFNME")= row("APFNME").ToString+" "+row("APLNME").ToString)

I want delete column APLNME Because I concatenate column APFNME and APLNME already.

Please guide me about it.

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