If we want to join varable list with table using linq we have to make variable of that table which we have to join. I got the solution and it is working also. below i have attached working code which i have solved:
var cf = from a in ent.Forms
select new
{
a.TaxFormID,
a.TaxFormName,
Name = a.TaxFormName,
a.Common
};
var custForms = cf.ToList();
var cmf = from a in entEP.FormsEPs
select new
{
a.TaxFormID,
a.TaxFormName,
Name = a.TaxFormName,
a.Common
};
var commonForms = cmf.ToList();
var formdoc = commonForms.Concat(custForms);
var alert = from a in ent.AlertNotifications
select new
{
a.AlertID,
a.AlertOnly,
a.EmailAdmin,
a.FormID,
a.Acknowledgment,
a.SignatureRequired,
a.NoNotification,
a.IsCommon
};
var alertno = alert.ToList();
var dt = from a in alertno
join b in formdoc on a.FormID equals b.TaxFormID
where a.IsCommon == b.Common
select new
{
a.AlertID,
a.AlertOnly,
a.EmailAdmin,
a.FormID,
b.TaxFormName,
a.Acknowledgment,
a.SignatureRequired,
a.NoNotification
};
Radgridformsdocuments.DataSource = dt.ToList();
DataTable d2 = ToDataTable(dt.ToList());
ViewState["Radgridformsdocuments"] = d2;