Hello, we are trying to get some data from Account entity in MSCRM 8 onpremise
we have sql query something like this (It is called from c# application):
select distinct top 100 acc.accountid,acc.OwnerId, ..., acc.v_ownerid
from account acc
where acc.statecode = 0 and (1=0 or acc.accountid= xxxx)
When I Try to run this select from my C# code I am getting an error:
System.Data.SqlClient.SqlException: Invalid column name 'acc.v_ownerid'.
The field 'acc.v_ownerid' for 100% exists in DB
- If I will run this select in Sql Management studio it will give me result
- If I run SQL profiler I will get sql query, which also returns result
- If I will run it from C# code, It will give me error above, if this field is removed it will work, but I need it..
Please where can be the problem?
Petr