vode
New Member
Posts: 11
|
Post by vode on Feb 12, 2010 7:12:49 GMT -5
I have found an issue The error occurs in case at least when I use a sub-select and the table and its field has the same name. It's OK if I convert the next query: SELECT A.BID FROM (SELECT * FROM B) AS A
But an error occurs if I use another field in the returned result: SELECT A.B FROM (SELECT * FROM B) AS A
SQL cannot be converted to LINQ: Field . not found in the current Data Context.Database script is as simple as possible: CREATE TABLE [B]( [BID] [int] IDENTITY(1,1) NOT NULL, [B] [float] NULL, CONSTRAINT [PK_B] PRIMARY KEY CLUSTERED ( [BID] ASC ) ON [PRIMARY] ) ON [PRIMARY]
GO
Good luck!
|
|
vode
New Member
Posts: 11
|
Post by vode on Feb 12, 2010 7:40:58 GMT -5
Another issue with such field is that the type of the field is incorrectly detected internally in the linqer (I think it has an int as a some kind of default value). Let me show:
SELECT ISNULL(B, 1) AS X FROM B
The field B has a SQL float type. But after conversion I got a result:
from t in db.B select new { X = ((int?)t.B1 ?? (int?)1) }
So I have nullable int instead of nullable double.
|
|
|
Post by Mikhail Oumantsev on Feb 13, 2010 3:50:01 GMT -5
Thanks for finding it. I've fixed these issues. The new update will be available next week.
|
|