Data access is not allowed in this context. Either the context is a function or method not marked with DataAccessKind.Read ...

Data access is not allowed in this context.  Either the context is a function or method not marked with DataAccessKind.Read or SystemDataAccessKind.Read, is a callback to obtain data from FillRow method of a Table Valued Function, or is a UDT validation method.