Link to home
Start Free TrialLog in
Avatar of Larry Brister
Larry BristerFlag for United States of America

asked on

vb.Net loop through Dataset.Table(0)

I have a dataset being returned from SQL Server into my web form

It has a column  called BatchNumber that can be from 1 to 1000 rows


I also have a comma seperated string
strMyList = "1,3,5,7"

I would like to remove from strMyList any value not in the "longer list"

So that if the dataset does not have BatchNumber 3 then
strMyList would = "1,5,7"
Avatar of Dorababu M
Dorababu M
Flag of India image

Can you explain more clearly may be by sending some screen shots of input and output
ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
based on my understanding for the requirement and referring to sample of Stefan in ID: 42431385, shouldn't that INTERSECT should be used instead of EXCEPT?

provided:

INSERT INTO @Batches ( BatchNumber )
VALUES ( 1 ) ,
       ( 5 ) ,
       ( 7 ) ,
       ( 9 );

DECLARE @Parameter VARCHAR(MAX) = '1,3,5,7';

Open in new window

@Ryan, indeed.. misinterpret the OP's requirement.
Avatar of Larry Brister

ASKER

Sorry for late get back
Thanks