Page 1 of 1

Linq2Oracle: "Sequence contains no matching element"

Posted: Wed 10 Sep 2008 10:25
by baretta
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

Posted: Thu 11 Sep 2008 12:52
by Shalex
Please send us your *.dbml file and the script that creates the database.

Posted: Fri 12 Sep 2008 12:03
by baretta
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?

Posted: Fri 12 Sep 2008 12:28
by Shalex
My e-mail is (alexsh at devart.com). We will investigate this problem and notify you as soon as possible.

Posted: Tue 13 Jan 2009 12:26
by Patroklo
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.

Posted: Tue 13 Jan 2009 13:05
by AndreyR
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.

Same Problem

Posted: Wed 11 Mar 2009 22:33
by degas
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

Posted: Thu 12 Mar 2009 08:43
by AndreyR
Please install .NET Framework 3.5 Service Pack 1. This should help.

Thanks

Posted: Thu 12 Mar 2009 17:10
by degas
This is the solution to the problem.
Thanks a lot a keep the GREAT WORK!!!!!!