Good day
I have a gridview with predefined columns . I have a linq to sql query where i name my selected values with the same name as the predefined column names.
After i set the datasource it adds new columns to the end of the gridview.
Here is my sql query
var res = (from s in db.SiteAudits
where s.SiteAuditID > 0000250 && s.SiteAuditID < 0000300
join ac in db.Accounts on s.AccountID equals ac.AccountID
join si in db.Sites on s.SiteID equals si.SiteID
join au in db.Audits on s.AuditID equals au.AuditID
select new
{
_siteauditid = s.SiteAuditID,
_account = ac.AccountName + "-" + si.SiteName,
_datedue = s.DateDue,
_audit = au.AuditTitle
}).ToList();
grd_unscheduledaudits.DataSource = res;
Is there a special way my columns should link to my query's result columns ?
I have a gridview with predefined columns . I have a linq to sql query where i name my selected values with the same name as the predefined column names.
After i set the datasource it adds new columns to the end of the gridview.
Here is my sql query
var res = (from s in db.SiteAudits
where s.SiteAuditID > 0000250 && s.SiteAuditID < 0000300
join ac in db.Accounts on s.AccountID equals ac.AccountID
join si in db.Sites on s.SiteID equals si.SiteID
join au in db.Audits on s.AuditID equals au.AuditID
select new
{
_siteauditid = s.SiteAuditID,
_account = ac.AccountName + "-" + si.SiteName,
_datedue = s.DateDue,
_audit = au.AuditTitle
}).ToList();
grd_unscheduledaudits.DataSource = res;
Is there a special way my columns should link to my query's result columns ?