OK, Im totally stumped with this one. I may not have enough info to post here, but I dont even know where to start looking. I'm trying to "Update Model from database" on my DAL.edmx file. I included a field to a view that wasnt included prior. I tried refreshing, and then I tried renaming the view in the database and deleting the view from the DAL so I could re-add it. Both times I got
Next, for no reason I tried adding my renamed view into the DAL, got same exception. Manually deleting from DAL.tt does not help. Googled issue and only 2 non-relevant results. I dont know where to even start looking.
I didnt write it, but here is the source sql of the view (if it helps). The fact that EF wouldnt add the renamed view hints it might be with the SQL? The SQL runs fine in mngmnt studio.
SELECT ID, IssueID, IssueTypeID, IssueText, IssueCreateDate, WeekendDate, CustomerName, Employee,
CONVERT(DECIMAL(6, 2), AdjustedTotalRHours, 101) AS AdjustedTotalRHours, AdjustedTotalOHours,
AdjustedTotalRHours + AdjustedTotalOHours AS Hours, InvoiceNumber, AdjustedInvoiceAmount,
COALESCE
((SELECT SUM(InvoiceAmount) AS Expr1
FROM TrendingDataFinal AS I1
WHERE (InvoiceNumber = T1.InvoiceNumber) AND (CompanyID = T1.CompanyID) AND
(CalType = 'F') AND (Aident = T1.Aident)), 0) AS TotalInvoiceAmount, InvoiceDate,
ROUND(DATEDIFF(DAY, InvoiceDate, GETDATE()), 0) AS DaysOutstanding, Notes, Aident, EINC, IsClosed,
CompanyID,
(SELECT COUNT(ne.EntryID) AS Expr1
FROM Madison.Notes.Note AS n INNER JOIN
Madison.Notes.NoteEntry AS ne ON n.NoteID = ne.NoteId
WHERE (n.Key1 = T1.InvoiceNumber)) AS HasNotes, COALESCE
((SELECT TOP (1) CompanyName
FROM ReportingCompanies AS I1
WHERE (CompanyId = T1.CompanyID)), '') AS CompanyName, BranchName, PayStatus
FROM BillMan_ReportStage AS T1
Any suggestions would be appreciated.
UPDATE: Created brand spanking new view with same SQL, went to add it by same method to DAL, same error.