Linq for fetching value from Datatable

Hi

I have datatable with a column called “queueName” and “Maxretries” .I need to take value of Maxreties for given queueName . QueueName will be a variable . I need to used linq for it.

Please help

Hi

I have datatable with a column called “queueName” and “Maxretries” .I need to take value of Maxreties for given queueName . QueueName will be a variable . I need to used linq for it.

Please help

@tharaninatarajan1901

Please try this

dt.AsEnumerable.Where(function(x) x("queueName").ToString.Equals("RequiredQueueName"))(0)("Maxretries").ToString

Assumption is you definitely have the queuename you are searchign in the table

cheers

1 Like

@tharaninatarajan1901

Dt.Select(“[Column1]=‘text’”).ElementAt(0)(“Column2”).ToString

@tharaninatarajan1901
Try this

Dt.Select(“[Column1]=‘text’”).ElementAt(0)(“Column2”).ToString

Duplicate of:

2 Likes

Hi @ppr,
Have merged the two and kept all posts intact. Thanks for spotting :+1:

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