Page 1 of 1

Issue wiht .ExecuteQUery

Posted: Mon 18 Oct 2010 16:17
by edstaffin
Hi, I have a simple class defined below and I am trying to do a db.ExecuteQuery but am having trouble.

Here is the code I am trying to run:

Dim sSql As String = "Select IT_Request_Seq, Title, Cost_Center_Name, Requested_By, Total_Score, Request_Year, Status_Name from V_IT_Request Where UPPER(Status_Name) = 'PENDING' ORDER BY Title"

Dim qry As IEnumerable(Of RequestSearchResults) = db.ExecuteQuery(Of RequestSearchResults)(sSql)

Code: Select all

    Private Class RequestSearchResults
        Public Property IT_Request_Seq As Int32
        Public Property Title As String
        Public Property Cost_Center_Name As String
        Public Property Requested_By As String
        Public Property Total_Score As Decimal
        Public Property Request_Year As Int32
        Public Property Status_Name As String
    End Class
WHen I run this code I get the following error:

Field with name _IT_Request_Seq is not found in resultset.

The important thing to note is the leading underscore. Where did that come from?

Thanks ... Ed

Posted: Tue 19 Oct 2010 16:48
by StanislavK
I send you a small test project, please check that it was not blocked by your mail filter. Please specify what should be changed in it to reproduce the problem, or, if possible, send us your sample. We couldn't reproduce the issue in our environment.

The table used in the sample is defined as

Code: Select all

CREATE TABLE DEPT 
(
  DEPTNO NUMBER(4),
  DNAME VARCHAR2(14),
  LOC VARCHAR2(13)
  CONSTRAINT PK_DEPT PRIMARY KEY (DEPTNO)
)