I am facing issue with the data which throwing error as no data row, but the data is visible still showing no data row.
can you please suggest for the resolution
(From row In dtMIADeceased Where
(row(“Paid”).ToString.Trim.Equals(“4”) And
Not row(“PRODUCT ECL”).ToString.Trim.Equals(“UT”) And
Not row(“MORT/RETAIL/OD/RSME”).ToString.trim.Equals(“OD”) And
Not row(“Interest Bucket”).ToString.trim.Equals(“Y”) And
(Not row(“NEW REGION”).ToString.trim.Equals(“SBH”) And Not row(“NEW REGION”).ToString.trim.Equals(“SWK”)) And
(Not row(“CATEGORY”).ToString.trim.Equals(“SMALL”) And Not row(“CATEGORY”).toString.trim.Equals(“OTHERS”)) And
row(“LOR LAST MONTHS”).ToString.trim.Equals(“”) And
(Not row(“UDF Tagging Account”).ToString.trim.Equals(“AKPK”) And Not row(“UDF Tagging Account”).ToString.trim.Equals(“BANKRUPT”) And
Not row(“UDF Tagging Account”).ToString.trim.Equals(“DECEASED”) And Not row(“UDF Tagging Account”).ToString.trim.Equals(“COMPLAINT”)) And
(Not row(“UDF Tagging Customer”).ToString.trim.Equals(“AKPK”) And Not row(“UDF Tagging Customer”).ToString.trim.Equals(“Bankrupt”) And
Not row(“UDF Tagging Customer”).ToString.trim.Equals(“Deceased”) And Not row(“UDF Tagging Customer”).ToString.trim.Equals(“Complaint”)) And
row(“Bankruptcy Filteration”).ToString.trim.Equals(“”) And
row(“Deceased Filteration”).ToString.trim.Equals(“”) And
row(“Complaint Filteration”).ToString.trim.Equals(“”) And
(Convert.ToDecimal(row(“Current Balance”)) > 30000.00)
) Select row).copytodatatable
If there is possibility the result has no datarow, it’s better to use DataRow array and use ToArray method instead of CopyToDataTable in LINQ. Then use check size the DataRow array and use copytodatatable if thers is one or more rows.
arrDR=(From row In dtMIADeceased Where
(row(“Paid”).ToString.Trim.Equals(“4”) And
Not row(“PRODUCT ECL”).ToString.Trim.Equals(“UT”) And
Not row(“MORT/RETAIL/OD/RSME”).ToString.trim.Equals(“OD”) And
Not row(“Interest Bucket”).ToString.trim.Equals(“Y”) And
(Not row(“NEW REGION”).ToString.trim.Equals(“SBH”) And Not row(“NEW REGION”).ToString.trim.Equals(“SWK”)) And
(Not row(“CATEGORY”).ToString.trim.Equals(“SMALL”) And Not row(“CATEGORY”).toString.trim.Equals(“OTHERS”)) And
row(“LOR LAST MONTHS”).ToString.trim.Equals(“”) And
(Not row(“UDF Tagging Account”).ToString.trim.Equals(“AKPK”) And Not row(“UDF Tagging Account”).ToString.trim.Equals(“BANKRUPT”) And
Not row(“UDF Tagging Account”).ToString.trim.Equals(“DECEASED”) And Not row(“UDF Tagging Account”).ToString.trim.Equals(“COMPLAINT”)) And
(Not row(“UDF Tagging Customer”).ToString.trim.Equals(“AKPK”) And Not row(“UDF Tagging Customer”).ToString.trim.Equals(“Bankrupt”) And
Not row(“UDF Tagging Customer”).ToString.trim.Equals(“Deceased”) And Not row(“UDF Tagging Customer”).ToString.trim.Equals(“Complaint”)) And
row(“Bankruptcy Filteration”).ToString.trim.Equals(“”) And
row(“Deceased Filteration”).ToString.trim.Equals(“”) And
row(“Complaint Filteration”).ToString.trim.Equals(“”) And
(Convert.ToDecimal(row(“Current Balance”)) > 30000.00)
) Select row).ToArray