Hi
I have a datatable where I wanted remove few records which matches the condition like :
I used filter data table to remove records which matches the condition.
Is it possible to remove data using LinQ? If yes then please help!
Hi
I have a datatable where I wanted remove few records which matches the condition like :
I used filter data table to remove records which matches the condition.
Is it possible to remove data using LinQ? If yes then please help!
Hi,
Can you please try the below query
YourDT.AsEnumerable.Where(Function(row) Not (String.IsNullOrEmpty(row(“smsReceived”).ToString) AndAlso Not row(“PhoneType”).ToString.Contains(“Home”) AndAlso String.IsNullOrEmpty(row(“IsActive”).ToString) OrElse row(“smsReceived”).ToString.Equals(“False”) AndAlso Not row(“PhoneType”).ToString.Contains(“Home”) AndAlso String.IsNullOrEmpty(row(“IsActive”).ToString) OrElse String.IsNullOrEmpty(row(“smsReceived”).ToString) AndAlso String.IsNullOrEmpty(row(“PhoneType”).ToString) AndAlso row(“IsActive”).ToString.Equals(“No”) OrElse String.IsNullOrEmpty(row(“smsReceived”).ToString) AndAlso Not row(“PhoneType”).ToString.Contains(“Home”) AndAlso row(“IsActive”).ToString.Equals(“No”))).CopyToDataTable()
Thankyou