I have a List<String> that has allowed columns. and I have a dataset DT1 which has all the columns listed . Now that i want to do is to only get allowed columns from DT1.
List<String> = FirstName,LastName,Age,EmailAddress
DT1 contains = FirstName,LastName,Age,EmailAddress,Sex,PhoneNumber,Address
I have already tried DataTable.Merge() , foreach etc… but i couldn’t get my expected result.
Assuming your list is a
List<String>containing the column names:Edit: You wanted to know how to set fields null which are in the removelist: