Assign: The source contains no DataRows

Hello everybody,

I’m having a problem with one of my assigns.

I have two datatables, who I compare, i only keep the datarows from one datatable that are not available in the other.

Sometimes it has no datarows but then i got this error: Assign: The source contains no DataRows.

I read some things about .select>0 but this doesn’t work in my assign. Does anyone has a solution for this assign?

assign:

dtOutput : (From t1 In dtPB0106.AsEnumerable() Group Join t2 In dtQuerie.AsEnumerable() On t1.Field(Of String)(“Column1”) Equals t2.Field(Of String)(“Column0”) Into tg = Group From tcheck In tg.DefaultIfEmpty() Where tcheck Is Nothing Select t1).CopyToDataTable()

This works perfectly when we have datarows :slight_smile:

@hansgeeroms,

Place a IF activity and inside that check for this,

(From t1 In dtPB0106.AsEnumerable() Group Join t2 In dtQuerie.AsEnumerable() On t1.Field(Of String)(“Column1”) Equals t2.Field(Of String)(“Column0”) Into tg = Group From tcheck In tg.DefaultIfEmpty() Where tcheck Is Nothing Select t1).Count > 0

Then in the true part place your linq to the dtOutput

3 Likes

That’s a very quickly answer and solution! Thanks :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.