LINQ: Datatable and List join return source contains no data row

T.Zacks 3,996 Reputation points
2021-04-03T12:52:22.61+00:00

I am joining a datatable and List<string> but getting error that source contaisn no datarow. here is my code. please tell me what mistake i have made for which i am getting error. both list<string> and datatable has data.

                    var result = (from bkr in ds.Tables[2].AsEnumerable()
                                  join prd in Listofperiods
                                      on bkr.Field<string>("StandardDate") equals prd.ToString()
                                  where string.IsNullOrEmpty(bkr.Field<string>("StandardValue"))
                                  select bkr).CopyToDataTable();
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,298 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.