Error IN DATATABLE

Dear Team,

I am trying to execute a Linq query on a DataTable.

from row in dt_table
where Cint(row(“Count”)) =2
select row ).CopyToDataTable()
However I am getting the following error.
Could not find an implementation of the query pattern for the source type ‘DataTable’ where not found.

DataTable.docx (240.7 KB)

Attached the screenshot. Can any one help on this?

Here you can get the different methods to filter a datatable.

Try with this below LINQ

(From row In DtBuild.AsEnumerable
Where CInt(row("Count")) =2
Select row ).CopyToDataTable()

image

Regards
Gokul

1 Like

Hi,

Can you try the following expression because you use C#.

(from row in dt_table.AsEnumerable()
where Int32.Parse(row["Count"].ToString()) ==2
select row ).CopyToDataTable()

Regards,

1 Like

Thank You so much.It worked.

1 Like

Thank You Gokul.

Hello Yoichi-san,

I have one more use case where I am using SAP appliucation.

Bot is using SAP application.

At first bot enters value in the text (Description) field.Then it selects value from three respective dropdown fields. Everytime it selects value from dropdown ,initially entered value in the field(Description) gets deleted automatically.
In the next section(page) bot is selecting value from list of values for another field. But as soon as it clicks on a button,values in two fields appears to be deleted.

Can you help on the issue"When the robot selects any value from dropdown the previously entered value is deleted automatically"

Regards

Hi,

Sorry but I’m not familiar with SAP application. Perhaps you should raise new topic, then experts will help you.

Regards,

1 Like

Thank You. Could you help me in this error.

Getting following error. Can not implicitly convert type System.Data.DataTable to System.Collections.Generic.IEnumerable

Once again Thanks in advance

Hi Gokul,

I have one more doubt. Could you help me in this.

Bot is using SAP application.

At first bot enters value in the text (Description) field.Then it selects value from three respective dropdown fields. Everytime it selects value from dropdown ,initially entered value in the field(Description) gets deleted automatically.
In the next section(page) bot is selecting value from list of values for another field. But as soon as it clicks on a button,values in two fields appears to be deleted.

Can you help on the issue"When the robot selects any value from dropdown the previously entered value is deleted automatically"

Hi,

Can you try the following

out_dt_table.AsEnumerable()

Then set DataRow in TypeArgument property in Parallel For Each.

BTW, do you need to use Parallel For Each? I recommend to use ForEach or ForEachRow if you don’t have special reason.

Regards,

1 Like

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