Linq2Oracle: "Sequence contains no matching element"

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
baretta
Posts: 6
Joined: Thu 03 Apr 2008 10:44
Location: OSLO

Linq2Oracle: "Sequence contains no matching element"

Post by baretta » Wed 10 Sep 2008 10:25

Hi

I use the Devart Linq2Oracle (Devart.Data.Linq) to access Oracle database from .NET.

I have a problem with iterating through the children of an object.

Our Person object has a OneToMany relationship with a postal adress table(one person may have 0 or more associated postal addresses).

As i try to iterate through the addresses on the Person object, a InvalidOperationException is thrown, with the message "Sequence contains no matching element".

It is really strange, because it works for 3 of my colleagues, but not for me. I have tried to uninstall and install again the Devart components, woth no luck.

I think that this error is thrown because the Devart.Data.Linq.MultiKeyManager invokes the System.Linq.Enumerable.Single method,
where it should invoke the SelectMany method, but i am not sure.

I tried to reproduce the problem with a very simple model, i used the SchemaModeller to import 3 tables with a OneToMany relationship,
and i am able to reproduce this error. But again, not my colleagues.

Have you ever come across this problem?


This is the stack trace:
at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)\r\n
at Devart.Data.Linq.MultiKeyManager`2.a()\r\n
at Devart.Data.Linq.MultiKeyManager`2.a(Type A_0)\r\n
at Devart.Data.Linq.MultiKeyManager`2.a(Type A_0)\r\n
at Devart.Data.Linq.MultiKeyManager`2.CreateDefault[TType]()\r\n
at Devart.Data.Linq.MultiKeyManager`2.a(T A_0)\r\n
at Devart.Data.Linq.Provider.EntityReader`2.a()\r\n
at Devart.Data.Linq.Provider.ObjectReader`1.MoveNext()\r\n
at System.Data.Linq.EntitySet`1.Load()\r\n
at System.Data.Linq.EntitySet`1.GetEnumerator()\r\n
at ConsoleApplication5.Program.Main(String[] args) in D:\dev\_temp\ConsoleApplication5\Program.cs:line 23\r\n
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)\r\n
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n
at System.Threading.ThreadHelper.ThreadStart()"


Regards,
Dennis

Shalex
Site Admin
Posts: 8248
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 11 Sep 2008 12:52

Please send us your *.dbml file and the script that creates the database.

baretta
Posts: 6
Joined: Thu 03 Apr 2008 10:44
Location: OSLO

Post by baretta » Fri 12 Sep 2008 12:03

I have made a simple data model and a console application to demonstrate this. However, i am not sure how to send this to you. Can you provide a mail address?

Shalex
Site Admin
Posts: 8248
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 12 Sep 2008 12:28

My e-mail is (alexsh at devart.com). We will investigate this problem and notify you as soon as possible.

Patroklo
Posts: 3
Joined: Mon 10 Nov 2008 13:04

Post by Patroklo » Tue 13 Jan 2009 12:26

I have the same error message in my project. Im using visual studio 2008 and in my computer works correctly, I use, also in my computer, the CassiniWebServer and it also works correctly, but when I send it to the server we use for intranet, when I use the source with the cassini web server, it gives this same error.

I have in both, my computer and server, the dcoracle500pro.exe installed and the same version of visual studio and Cassini.

Coul you please help me? Thanks in advance.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Tue 13 Jan 2009 13:05

Could you please send me (andreyr * devart * com) the stack trace of the exception?
If possible, make a small test project illustrating the error and send it to me as well.

degas
Posts: 77
Joined: Mon 16 Feb 2009 18:36
Location: Argentina

Same Problem

Post by degas » Wed 11 Mar 2009 22:33

Hello:

I have the same problem. It works fine on several machines (XP and Widows Server X64), but on an Windows Server 2003 SP1 with IIS 6.0 doesn`t. Even strager, is that the DataContext gets connected to the database and if i comment the lines (
DegNetData.LogDegnets.InsertOnSubmit(log);
DegNetData.SubmitChanges();
)

Here is the stacktrace (yellow page):


[InvalidOperationException: La secuencia no contiene ningún elemento coincidente]
System.Linq.Enumerable.Single(IEnumerable`1 source, Func`2 predicate) +320
Devart.Data.Linq.MultiKeyManager`2.a() +308
Devart.Data.Linq.MultiKeyManager`2.a(Type A_0) +383
Devart.Data.Linq.MultiKeyManager`2.a(Type A_0) +172
Devart.Data.Linq.MultiKeyManager`2.CreateDefault() +157
Devart.Data.Linq.MultiKeyManager`2.CreateKeyFromInstance(T obj) +117
Devart.Data.Linq.KeyManager`2.a(Object A_0) +47
Devart.Data.Linq.Table`1.a(Object A_0, MetaType A_1) +199
Devart.Data.Linq.Table`1.b(Object A_0, MetaType A_1, Dictionary`2 A_2) +260
Devart.Data.Linq.Table`1.InsertOnSubmit(TEntity entity) +242
DEGNET.GUI.WebForm1.LogLoginStatus(Usuario Usuario, DegNetPage LoginStatus) in c:\Degas3\DegNetWeb\wfrmLogin.aspx.cs:104
DEGNET.GUI.WebForm1.Login(LoginEnventArgs e) in c:\Degas3\DegNetWeb\wfrmLogin.aspx.cs:65
DEGNET.GUI.WebForm1.LoginButton_Click(LoginEnventArgs e) in c:\Degas3\DegNetWeb\wfrmLogin.aspx.cs:89
szicom.aspnet.controls.Login.Login_Click(Object sender, EventArgs e) in c:\Degas3\DegNetWeb\WebControls\Login.ascx.cs:93
DevExpress.Web.ASPxEditors.ASPxButton.OnClick(EventArgs e) +75
DevExpress.Web.ASPxEditors.ASPxButton.RaisePostBackEvent(String eventArgument) +382
DevExpress.Web.ASPxClasses.ASPxWebControl.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 12 Mar 2009 08:43

Please install .NET Framework 3.5 Service Pack 1. This should help.

degas
Posts: 77
Joined: Mon 16 Feb 2009 18:36
Location: Argentina

Thanks

Post by degas » Thu 12 Mar 2009 17:10

This is the solution to the problem.
Thanks a lot a keep the GREAT WORK!!!!!!

Post Reply