In clause
In clause
In normal linq2sql I can create an in clause using syntax similar to:
Dim qry = From x In db.YourTable Where (From y In _
db.Table2 Where y.field = 123 _
Select y.field).Contains(x.field) _
Select New With {x.field}
However when I try something similar to this using your product I get the following error:
"Method 'CompareObjectEqual' has no supported translation to SQL."
Do you no support this?
Also, do you now or will you be supporting the SqlMethods object calls? In particular, I am interested in SqlMethods.Like().
Thanks ... Ed
Dim qry = From x In db.YourTable Where (From y In _
db.Table2 Where y.field = 123 _
Select y.field).Contains(x.field) _
Select New With {x.field}
However when I try something similar to this using your product I get the following error:
"Method 'CompareObjectEqual' has no supported translation to SQL."
Do you no support this?
Also, do you now or will you be supporting the SqlMethods object calls? In particular, I am interested in SqlMethods.Like().
Thanks ... Ed
I have this calls:
decimal[] included = new decimal[]{111111,222222};
var dataEntryQuery = Entities.DATA_ENTRY.Where( c => included.Contains(c.DATA_ENTRY_ID) );
note that c.DATA_ENTRY_ID is defined as decimal.
It threw an exception:
System.NotSupportedException
LINQ to Entities does not recognize the method 'Boolean Contains[String](System.Collections.Generic.IEnumerable`1[System.String], System.String)' method, and this method cannot be translated into a store expression.
What am I doing wrong?
decimal[] included = new decimal[]{111111,222222};
var dataEntryQuery = Entities.DATA_ENTRY.Where( c => included.Contains(c.DATA_ENTRY_ID) );
note that c.DATA_ENTRY_ID is defined as decimal.
It threw an exception:
System.NotSupportedException
LINQ to Entities does not recognize the method 'Boolean Contains[String](System.Collections.Generic.IEnumerable`1[System.String], System.String)' method, and this method cannot be translated into a store expression.
What am I doing wrong?
We have tested dotConnect for Oracle Beta version 5.00.
The following code is working fine (for table Emp):
The following code is working fine (for table Emp):
Code: Select all
string[] names = new string[] { "SMITH", "ALLEN" };
var dataEntryQuery = db.EMPs.Where(c => names.Contains(c.ENAME));
I tried with 5.0 and here's what I got. Any clue?
Test method CaridianBCT.Vcl.Domain.BusinessObjects.IntegrationTest.DataTestt.TestMethod9 threw exception: System.NotSupportedException: LINQ to Entities does not recognize the method 'Boolean Contains[String](System.Collections.Generic.IEnumerable`1[System.String], System.String)' method, and this method cannot be translated into a store expression..
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.DefaultTranslator.Translate(ExpressionConverter parent, MethodCallExpression call)
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.TypedTranslate(ExpressionConverter parent, MethodCallExpression linq)
Translate(ExpressionConverter parent, Expression linq)
System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq)
System.Data.Objects.ELinq.ExpressionConverter.TranslateLambda(LambdaExpression lambda, DbExpression input)
System.Data.Objects.ELinq.ExpressionConverter.TranslateLambda(LambdaExpression lambda, DbExpression input, DbExpressionBinding& binding)
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.OneLambdaTranslator.Translate(ExpressionConverter parent, MethodCallExpression call, DbExpression& source, DbExpressionBinding& sourceBinding, DbExpression& lambda)
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.OneLambdaTranslator.Translate(ExpressionConverter parent, MethodCallExpression call)
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.SequenceMethodTranslator.Translate(ExpressionConverter parent, MethodCallExpression call, SequenceMethod sequenceMethod)
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.TypedTranslate(ExpressionConverter parent, MethodCallExpression linq)
Translate(ExpressionConverter parent, Expression linq)
System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq)
System.Data.Objects.ELinq.ExpressionConverter.Convert()
System.Data.Objects.ELinq.ELinqQueryState.GetExecutionPlan(Nullable`1 forMergeOption)
GetResults(Nullable`1 forMergeOption)
GetEnumerator()
CaridianBCT.Vcl.Domain.BusinessObjects.IntegrationTest.DataTestt.TestMethod9() in D:\VCL\Projects\ASM\Main\IntegrationTest\CaridianBCT.Vcl.Domain.BusinessObjects.IntegrationTest\DataTestt.cs: line 200
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.DefaultTranslator.Translate(ExpressionConverter parent, MethodCallExpression call)
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.TypedTranslate(ExpressionConverter parent, MethodCallExpression linq)
Translate(ExpressionConverter parent, Expression linq)
System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq)
System.Data.Objects.ELinq.ExpressionConverter.TranslateLambda(LambdaExpression lambda, DbExpression input)
System.Data.Objects.ELinq.ExpressionConverter.TranslateLambda(LambdaExpression lambda, DbExpression input, DbExpressionBinding& binding)
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.OneLambdaTranslator.Translate(ExpressionConverter parent, MethodCallExpression call, DbExpression& source, DbExpressionBinding& sourceBinding, DbExpression& lambda)
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.OneLambdaTranslator.Translate(ExpressionConverter parent, MethodCallExpression call)
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.SequenceMethodTranslator.Translate(ExpressionConverter parent, MethodCallExpression call, SequenceMethod sequenceMethod)
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.TypedTranslate(ExpressionConverter parent, MethodCallExpression linq)
Translate(ExpressionConverter parent, Expression linq)
System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq)
System.Data.Objects.ELinq.ExpressionConverter.Convert()
System.Data.Objects.ELinq.ELinqQueryState.GetExecutionPlan(Nullable`1 forMergeOption)
GetResults(Nullable`1 forMergeOption)
GetEnumerator()
CaridianBCT.Vcl.Domain.BusinessObjects.IntegrationTest.DataTestt.TestMethod9() in D:\VCL\Projects\ASM\Main\IntegrationTest\CaridianBCT.Vcl.Domain.BusinessObjects.IntegrationTest\DataTestt.cs: line 200
Opppss....
I tried the ff code:
[TestMethod]
public void TestMethod10()
{
string[] decs = new string[]{ "HB_SCALING", "HB_LOSS_CORRECTION" };
var query = entities.SYSTEM_CONFIGURATION_TYPE.Where(c=> decs.Contains(c.SYSTEM_CONFIGURATION_NAME));
foreach (SYSTEM_CONFIGURATION_TYPE configType in query)
.....
I got the ff errors:
Test method CaridianBCT.Vcl.Domain.BusinessObjects.IntegrationTest.DataTestt.TestMethod10 threw exception: System.NotSupportedException: LINQ to Entities does not recognize the method 'Boolean Contains[String](System.Collections.Generic.IEnumerable`1[System.String], System.String)' method, and this method cannot be translated into a store expression..
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.DefaultTranslator.Translate(ExpressionConverter parent, MethodCallExpression call)
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.TypedTranslate(ExpressionConverter parent, MethodCallExpression linq)
Translate(ExpressionConverter parent, Expression linq)
System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq)
System.Data.Objects.ELinq.ExpressionConverter.TranslateLambda(LambdaExpression lambda, DbExpression input)
System.Data.Objects.ELinq.ExpressionConverter.TranslateLambda(LambdaExpression lambda, DbExpression input, DbExpressionBinding& binding)
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.OneLambdaTranslator.Translate(ExpressionConverter parent, MethodCallExpression call, DbExpression& source, DbExpressionBinding& sourceBinding, DbExpression& lambda)
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.OneLambdaTranslator.Translate(ExpressionConverter parent, MethodCallExpression call)
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.SequenceMethodTranslator.Translate(ExpressionConverter parent, MethodCallExpression call, SequenceMethod sequenceMethod)
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.TypedTranslate(ExpressionConverter parent, MethodCallExpression linq)
Translate(ExpressionConverter parent, Expression linq)
System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq)
System.Data.Objects.ELinq.ExpressionConverter.Convert()
System.Data.Objects.ELinq.ELinqQueryState.GetExecutionPlan(Nullable`1 forMergeOption)
GetResults(Nullable`1 forMergeOption)
GetEnumerator()
CaridianBCT.Vcl.Domain.BusinessObjects.IntegrationTest.DataTestt.TestMethod10() in D:\VCL\Projects\ASM\Main\IntegrationTest\CaridianBCT.Vcl.Domain.BusinessObjects.IntegrationTest\DataTestt.cs: line 213
I tried the ff code:
[TestMethod]
public void TestMethod10()
{
string[] decs = new string[]{ "HB_SCALING", "HB_LOSS_CORRECTION" };
var query = entities.SYSTEM_CONFIGURATION_TYPE.Where(c=> decs.Contains(c.SYSTEM_CONFIGURATION_NAME));
foreach (SYSTEM_CONFIGURATION_TYPE configType in query)
.....
I got the ff errors:
Test method CaridianBCT.Vcl.Domain.BusinessObjects.IntegrationTest.DataTestt.TestMethod10 threw exception: System.NotSupportedException: LINQ to Entities does not recognize the method 'Boolean Contains[String](System.Collections.Generic.IEnumerable`1[System.String], System.String)' method, and this method cannot be translated into a store expression..
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.DefaultTranslator.Translate(ExpressionConverter parent, MethodCallExpression call)
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.TypedTranslate(ExpressionConverter parent, MethodCallExpression linq)
Translate(ExpressionConverter parent, Expression linq)
System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq)
System.Data.Objects.ELinq.ExpressionConverter.TranslateLambda(LambdaExpression lambda, DbExpression input)
System.Data.Objects.ELinq.ExpressionConverter.TranslateLambda(LambdaExpression lambda, DbExpression input, DbExpressionBinding& binding)
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.OneLambdaTranslator.Translate(ExpressionConverter parent, MethodCallExpression call, DbExpression& source, DbExpressionBinding& sourceBinding, DbExpression& lambda)
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.OneLambdaTranslator.Translate(ExpressionConverter parent, MethodCallExpression call)
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.SequenceMethodTranslator.Translate(ExpressionConverter parent, MethodCallExpression call, SequenceMethod sequenceMethod)
System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.TypedTranslate(ExpressionConverter parent, MethodCallExpression linq)
Translate(ExpressionConverter parent, Expression linq)
System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq)
System.Data.Objects.ELinq.ExpressionConverter.Convert()
System.Data.Objects.ELinq.ELinqQueryState.GetExecutionPlan(Nullable`1 forMergeOption)
GetResults(Nullable`1 forMergeOption)
GetEnumerator()
CaridianBCT.Vcl.Domain.BusinessObjects.IntegrationTest.DataTestt.TestMethod10() in D:\VCL\Projects\ASM\Main\IntegrationTest\CaridianBCT.Vcl.Domain.BusinessObjects.IntegrationTest\DataTestt.cs: line 213