How to Check any DatatRow Available in Another Datatable

Hii Team
I m Having a Master Datatable and i m Scraping data from a another website and i need to check if the Scape data is Available in the Master Datatable

Dose anyone know a Better way than this Both Tables Headers are same

i m using Join datable now

Thank you

Hi @Tharusha_Fernando

Try to use Linq query, Apart from using a join.

dt1.AsEnumerable().ToList().ForEach(Sub(row) row(“Scope”)= If(dt2.AsEnumerable().Where(Function(r) r(“Name”).ToString.Equals(row(“Name”).ToString)).Count<>0,dt2.AsEnumerable().Where(Function(r) r(“Name”).ToString.Equals(row(“Name”).ToString))(0)(“Scope”).ToString, Nothing))

  • Use this code to invoke code with dt1 as in/out argument and dt2 as in the argument here
  • I am assuming that dt1 is Input Table
  • dt2 is Output Table

Hope it helps

Regards
Gokul

hi @Gokul001
i m Having Around 30 Columns
is their another way without mentioning the table headers

Thank you
Tharusha