If condition Problem

Dear All,

I have created an if condition which is nested in for each loop were you screen scrape a particular type of data that divides the data into 2 types. Type 1 and Type 2

In the current scenario, if the Type 1 data is in the first row of the data table then it will classify data into Type 1.

The problems come in when the Type 1 data is in the middle rows. Still, it will assign the values of previous Type 2 only.

At the beginning of the process, there is no scope to find out type 1 data and type 2 data separately.

I also have tried to delay the if condition still it doesn’t work.

Thanks
Syed Kashif Nasar

try with this IF condition in the beginning of FOR EACH ROW loop
row.ItemArray.Contains(Type1.ToString)
if thiis is true it will go to THEN part where we can keep related set of sequences to be followed

or if its a FOR EACH loop
then
dt.Rows(0).ItemArray.Contains(Type1.ToString)

Cheers @Syed_Kashif_Nasar

@Palaniyappan means I have to remove if condition from for each loop and then create separate loops.

**row.ItemArray.Contains(Type1.ToString)**is there a way to use this condition when the if condtion is outside the loop.

kindly use this when if Condition is outside the loop
because we need row variable to use the expression you mentioned
Cheers @Syed_Kashif_Nasar