This question is locked. New answers and comments are not allowed.
Hi,
i try to get this code snippet working
but i am getting the following error message:
How can i put the three fields City, HH1 and HH2 into one value field for the dictionary?
Thanks for every comment!
i try to get this code snippet working
AddInfos = (From Infos In m_gdScope.Extent(Of HouseHoldsZip)() _
Select New With {Infos.Zip, .Value = Infos.City & "|" & Infos.HH1 & "|" & Infos.HH2}).OrderBy(Function(p) p.Zip).ToDictionary(Function(dic) dic.Zip, Function(dic) dic.Value)
System.InvalidOperationException was not handled.
Message="An exception occured during the execution of '\r\nExtent<
GeoDataClasses.HouseholdsZip
>.Select(Infos => new VB$AnonymousType_21`2(Zip = Infos.Zip, Value = Concat(new [] {Infos.City, \"|\", (Infos.HH1 ?? null), \"|\", (Infos.HH2 ?? null)})))'. See InnerException for more details.\r\n"
Source="Telerik.OpenAccess.35.Extensions"
StackTrace:
at Telerik.OpenAccess.Query.ExpressionCompiler.PerformDatabaseQuery(Type type, Int32 elementAt, Object[] groupResolutionParamValues)
at Telerik.OpenAccess.Query.ExpressionExecution.PerformDatabaseQuery[T](Piece`1 piece, Object[] grpVals)
at Telerik.OpenAccess.Query.Piece`1.System.Collections.Generic.IEnumerable<
T
>.GetEnumerator()
at Telerik.OpenAccess.Query.TypedEnumerableWrapper`1.GetEnumerator()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.OrderedEnumerable`1.<
GetEnumerator
>d__0.MoveNext()
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector)
at MediaCenter.MedienSelektionKonzepte.btnAddConcept_Click(Object sender, EventArgs e) in C:\Projects\MediaCenter\MediaCenter\Forms\MediaSelectionConcepts.vb:Row 399.
at System.Windows.Forms.Control.OnClick(EventArgs e)
at Telerik.WinControls.RadControl.OnClick(EventArgs e)
at Telerik.WinControls.UI.RadButton.ButtonElement_Click(Object sender, EventArgs e)
at Telerik.WinControls.RadItem.OnClick(EventArgs e)
at Telerik.WinControls.UI.RadButtonItem.OnClick(EventArgs e)
at Telerik.WinControls.RadItem.DoClick(EventArgs e)
at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
at Telerik.WinControls.RadElement.DoMouseUp(MouseEventArgs e)
at Telerik.WinControls.ComponentInputBehavior.OnMouseUp(MouseEventArgs e)
at Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at Telerik.WinControls.RadControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at MediaCenter.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:Row 81.
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
at System.Activator.CreateInstance(ActivationContext activationContext)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.InvalidCastException
Message="The object of type \"System.Linq.Expressions.NewArrayExpression\" cannot be converted to Type \"OpenAccessRuntime.DataObjects.query.Node\
Source="Telerik.OpenAccess.35.Extensions"
StackTrace:
at Telerik.OpenAccess.Query.ExpressionCompiler.PerformDatabaseQueryImpl(Type type, Int32 elementAt, Object[] groupResolutionParamValues)
at
Telerik.OpenAccess.Query.ExpressionCompiler.PerformDatabaseQuery(Type type, Int32 elementAt, Object[] groupResolutionParamValues)
InnerException:
How can i put the three fields City, HH1 and HH2 into one value field for the dictionary?
Thanks for every comment!