3
Answers

Linq 'IN' function and string between data range

how to produce the SQL 'IN' function in the Linq below, then upon the return dataset how to produce the in between data range which is a string value from the dataset.

I want to express logic below in linq 

 where serialList IN ('serial1', 'serial2', 'serial')

I want to express logic below in linq also for dataFileWriteTime

where dataFileWriteTime >= ''' +
     @StartDate + ''' AND dataFileWriteTime <= ''' + @EndDate + ''''

LINQ EXAMPLE: I want to add the above logic to the linq below. Can someone assist me.

var  ReportList = (from l in ExampleTable.Enumerable()
                                                            where l["TEST_SET_IDENTIFICATION"] == testIdentificationList &&
                                                            l["SERIAL_NUMBER"] == serialList &&
                                                            l["DATA_WRITE_TIME"] == dateWriteTime &&
                                                            select l).ToList();

Answers (3)