User-698989805 posted
Hello Friends!! I've posted a question earlier and got to know it is not possible to concatenate in linq query. But how could I implement the following sql into linq and is it possible anyway to convert??
string IfExists;
if (ddlSupplier.SelectedValue != 0)
{
if (IfExists != "")
{
IfExists += " WHERE m.Supplier = @SupplierID ";
}
}
string selectString = "SELECT COUNT(m.TargetID) TotalRow FROM ResellerTarget m " +
"LEFT JOIN Supplier k on k.SupplierID = m.SupplierID LEFT JOIN Currency l on l.CurrID = m.CurrID LEFT JOIN TargetMonth p on p.MonthID = m.TargetMonth " + IfExists;