Linq2Oracle: "Sequence contains no matching element"
Linq2Oracle: "Sequence contains no matching element"
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
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
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.
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.
Same Problem
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
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