Assigning a variable in Equals method of select statement

Hi all,

Can anyone please tell me of how to assign a variable in equals method of select statement in below statement.

(From p In opinputdb.Select
Where p(2).ToString.Equals()
Select p).ToArray.CopyToDataTable

1 Like

Fine we can directly mention the variable as arguments to equals
like this
(From p In opinputdb.Select
Where p(2).ToString.Equals(variable.ToString)
Select p).ToArray.CopyToDataTable

Hope this would help you
kindly correct me if i m wrong
Cheers @Shivaraju

2 Likes

were we able to accomplish this
Cheers @Shivaraju

2 Likes

Hi @Palaniyappan
Thank you, it has worked.
But main problem is to filter the column(“Order”) of the excel and then sum all the values of column(“Quantity”) and save into another sheet.sampleexcel.xlsx (9.6 KB)

1 Like

Great
may i know what to filter in the order column
Cheers @Shivaraju

2 Likes

I want to filter the column with each unique value and then sum all the values present in the "Quantity"column. Later save into another sheet.

1 Like