This table/view has been excluded. To use the entity, you will need to review your schema, add the correct keys, and uncomment it.
Here is my view:
WITH temptable (code, DataItem, description) AS
(
SELECT
code,
CAST(LEFT(description, CHARINDEX(CHAR(10), description + CHAR(10)) - 1) AS nvarchar(50)) AS Expr1,
CAST(STUFF(description, 1, CHARINDEX(CHAR(10), description + CHAR(10)), '') AS nvarchar(50)) AS Expr2
FROM
dbo.book
WHERE
(idbook = 1)
UNION ALL
SELECT
code,
CAST(LEFT(description, CHARINDEX(CHAR(10), description + CHAR(10)) - 1) AS nvarchar(50)) AS Expr1,
CAST(STUFF(description, 1, CHARINDEX(CHAR(10), description + CHAR(10)), '') AS nvarchar(50)) AS Expr2
FROM
temptable AS temptable_2
WHERE
(description > '')),
testno AS
(
SELECT code, DataItem
FROM temptable AS temptable_1
)
SELECT TOP (100) PERCENT
REPLACE(testno_1.DataItem, ' ', ' ') AS predmet,
po.code, year, info
FROM
testno AS testno_1
LEFT OUTER JOIN
dbo.book AS book_1 ON testno_1.code = book_1.code
LEFT OUTER JOIN
dbo.Getbook AS po ON testno_1.code = po.code
ORDER BY
po.code
This problem is in my model.edmx
, I need view to generate report, but when I try to update model and put entity in it, it showed me an error which I mention in title on the top.
My connection to the dbo is good everything is ok, so only problem is primary key for view. I know that primary key cannot be in view but I think that always exist solution.