<html> <head> <META http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Native Queries</title> <link rel="stylesheet" type="text/css" href="../../../style.css"> </head> <body> <div class="CommonContent"> <div class="CommonContentArea"> <h1>Native Queries</h1><script> //We attach this function to a browser object as a variable so that if multiple of these blocks are //present on the same page, then they will simply over-write eachother with the same function instead //of generating a naming collision. window.WikiCodeFormattingCopyToClipboard = function copyToClipboard(sID){ var sContent = document.getElementById(sID).innerText; if( window.clipboardData && clipboardData.setData ) { clipboardData.setData("Text", sContent); } else { alert("You must enable javascript access to your clipboard for this feature to work. Please referr to your browser documentation or Google search for instructions."); } } </script> <p>We have checked in the SODA topic that SODA queries can work with a server without application classes deployed. So we can expect optimized Native Queries (converted to SODA under the hood) to work as well:<br> </p> <p> </p> <p> <span name="cs_wiki_filter" csw_filters="cs"></p> <div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">Client.cs: <span class="fscMemberName">GetPilotsNative</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55"><div><!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><span style="color: #008080;">01</span><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> GetPilotsNative() </span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_46_541_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_46_541_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_46_541_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_46_541_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_46_541_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_46_541_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_46_541_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_46_541_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_46_541_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_46_541_Open_Text"><span style="color: #000000;">{ </span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> Console.WriteLine(</span><span style="color: #800000;">"</span><span style="color: #800000;">Retrieving Pilot objects: Native Query</span><span style="color: #800000;">"</span><span style="color: #000000;">); </span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> IObjectContainer oc </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.OpenClient(</span><span style="color: #800000;">"</span><span style="color: #800000;">localhost</span><span style="color: #800000;">"</span><span style="color: #000000;">, </span><span style="color: #800080;">0xdb40</span><span style="color: #000000;">, </span><span style="color: #800000;">"</span><span style="color: #800000;">db4o</span><span style="color: #800000;">"</span><span style="color: #000000;">, </span><span style="color: #800000;">"</span><span style="color: #800000;">db4o</span><span style="color: #800000;">"</span><span style="color: #000000;">); </span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">try</span><span style="color: #000000;"> </span><span style="color: #008080;">06</span><span style="color: #000000;"><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_244_455_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_244_455_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_244_455_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_244_455_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_244_455_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_244_455_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_244_455_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_244_455_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_244_455_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_244_455_Open_Text"><span style="color: #000000;">{ </span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> IList</span><span style="color: #000000;"><</span><span style="color: #000000;">Pilot</span><span style="color: #000000;">></span><span style="color: #000000;"> result </span><span style="color: #000000;">=</span><span style="color: #000000;"> oc.Query</span><span style="color: #000000;"><</span><span style="color: #000000;">Pilot</span><span style="color: #000000;">></span><span style="color: #000000;">(</span><span style="color: #0000FF;">delegate</span><span style="color: #000000;">(Pilot pilot) </span><span style="color: #008080;">08</span><span style="color: #000000;"><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_338_403_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_338_403_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_338_403_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_338_403_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_338_403_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_338_403_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_338_403_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_338_403_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_338_403_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_338_403_Open_Text"><span style="color: #000000;">{ </span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> pilot.Points </span><span style="color: #000000;">==</span><span style="color: #000000;"> </span><span style="color: #800080;">5</span><span style="color: #000000;">; </span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/> }</span></span><span style="color: #000000;">); </span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> ListResult(result); </span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/> }</span></span><span style="color: #000000;"> </span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">finally</span><span style="color: #000000;"> </span><span style="color: #008080;">14</span><span style="color: #000000;"><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_488_531_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_488_531_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_488_531_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_488_531_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_488_531_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_488_531_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_488_531_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_488_531_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_488_531_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNative_295_55_488_531_Open_Text"><span style="color: #000000;">{ </span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> oc.Close(); </span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/> }</span></span><span style="color: #000000;"> </span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/> }</span></span></div></pre></div></div> <p></span> </p> <p> <span name="cs_wiki_filter" csw_filters="vb"></p> <div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">Client.vb: <span class="fscMemberName">GetPilotsNative</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_GetPilotsNative_427_55"><div><!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><span style="color: #008080;">01</span><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_GetPilotsNative_427_55_15_434_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_GetPilotsNative_427_55_15_434_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_GetPilotsNative_427_55_15_434_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_GetPilotsNative_427_55_15_434_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_GetPilotsNative_427_55_15_434_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_GetPilotsNative_427_55_15_434_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_GetPilotsNative_427_55_15_434_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_GetPilotsNative_427_55_15_434_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_GetPilotsNative_427_55_15_434_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub GetPilotsNative()</span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_GetPilotsNative_427_55_15_434_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> GetPilotsNative() </span><span style="color: #008080;">02</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> Console.WriteLine(</span><span style="color: #800000;">"</span><span style="color: #800000;">Retrieving Pilot objects: Native Query</span><span style="color: #800000;">"</span><span style="color: #000000;">) </span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> oc </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.OpenClient(</span><span style="color: #800000;">"</span><span style="color: #800000;">localhost</span><span style="color: #800000;">"</span><span style="color: #000000;">, </span><span style="color: #000000;">&</span><span style="color: #000000;">HDB40, </span><span style="color: #800000;">"</span><span style="color: #800000;">db4o</span><span style="color: #800000;">"</span><span style="color: #000000;">, </span><span style="color: #800000;">"</span><span style="color: #800000;">db4o</span><span style="color: #800000;">"</span><span style="color: #000000;">) </span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">Try</span><span style="color: #000000;"> </span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> result </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IList(</span><span style="color: #0000FF;">Of</span><span style="color: #000000;"> Pilot) </span><span style="color: #000000;">=</span><span style="color: #000000;"> oc.Query(</span><span style="color: #0000FF;">Of</span><span style="color: #000000;"> Pilot)(</span><span style="color: #0000FF;">AddressOf</span><span style="color: #000000;"> Pilot5Points) </span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> ListResult(result) </span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">Finally</span><span style="color: #000000;"> </span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> oc.Close() </span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">End</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Try</span><span style="color: #000000;"> </span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/> </span><span style="color: #0000FF;">End Sub</span></span></div></pre></div></div><div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">Client.vb: <span class="fscMemberName">Pilot5Points</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_Pilot5Points_482_48"><div><!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><span style="color: #008080;">1</span><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_Pilot5Points_482_48_15_132_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_Pilot5Points_482_48_15_132_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_Pilot5Points_482_48_15_132_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_Pilot5Points_482_48_15_132_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_Pilot5Points_482_48_15_132_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_Pilot5Points_482_48_15_132_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_Pilot5Points_482_48_15_132_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_Pilot5Points_482_48_15_132_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_Pilot5Points_482_48_15_132_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Function Pilot5Points()</span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_Pilot5Points_482_48_15_132_Open_Text"><span style="color: #0000FF;">Function</span><span style="color: #000000;"> Pilot5Points(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> pilot </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Pilot) </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Boolean</span><span style="color: #000000;"> </span><span style="color: #008080;">2</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">Return</span><span style="color: #000000;"> pilot.Points.Equals(</span><span style="color: #800080;">5</span><span style="color: #000000;">) </span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/> </span><span style="color: #0000FF;">End Function</span></span></div></pre></div></div> <br></p> <p></span></p> <p>Unfortunately, if the query cannot be optimized to SODA, the server needs to instantiate the classes to run the query. This is not possible if the class is not available</p> <p>This query won't work:</p> <p> </p> <p> <span name="cs_wiki_filter" csw_filters="cs"></p> <div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">Client.cs: <span class="fscMemberName">GetPilotsNativeUnoptimized</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66"><div><!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><span style="color: #008080;">01</span><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> GetPilotsNativeUnoptimized() </span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_57_568_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_57_568_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_57_568_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_57_568_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_57_568_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_57_568_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_57_568_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_57_568_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_57_568_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_57_568_Open_Text"><span style="color: #000000;">{ </span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> Console.WriteLine(</span><span style="color: #800000;">"</span><span style="color: #800000;">Retrieving Pilot objects: Native Query Unoptimized</span><span style="color: #800000;">"</span><span style="color: #000000;">); </span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> IObjectContainer oc </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.OpenClient(</span><span style="color: #800000;">"</span><span style="color: #800000;">localhost</span><span style="color: #800000;">"</span><span style="color: #000000;">, </span><span style="color: #800080;">0xdb40</span><span style="color: #000000;">, </span><span style="color: #800000;">"</span><span style="color: #800000;">db4o</span><span style="color: #800000;">"</span><span style="color: #000000;">, </span><span style="color: #800000;">"</span><span style="color: #800000;">db4o</span><span style="color: #800000;">"</span><span style="color: #000000;">); </span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">try</span><span style="color: #000000;"> </span><span style="color: #008080;">06</span><span style="color: #000000;"><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_267_482_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_267_482_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_267_482_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_267_482_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_267_482_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_267_482_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_267_482_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_267_482_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_267_482_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_267_482_Open_Text"><span style="color: #000000;">{ </span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> IList</span><span style="color: #000000;"><</span><span style="color: #000000;">Pilot</span><span style="color: #000000;">></span><span style="color: #000000;"> result </span><span style="color: #000000;">=</span><span style="color: #000000;"> oc.Query</span><span style="color: #000000;"><</span><span style="color: #000000;">Pilot</span><span style="color: #000000;">></span><span style="color: #000000;">(</span><span style="color: #0000FF;">delegate</span><span style="color: #000000;">(Pilot pilot) </span><span style="color: #008080;">08</span><span style="color: #000000;"><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_361_430_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_361_430_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_361_430_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_361_430_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_361_430_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_361_430_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_361_430_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_361_430_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_361_430_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_361_430_Open_Text"><span style="color: #000000;">{ </span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> pilot.Points </span><span style="color: #000000;">%</span><span style="color: #000000;"> </span><span style="color: #800080;">2</span><span style="color: #000000;"> </span><span style="color: #000000;">==</span><span style="color: #000000;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">; </span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/> }</span></span><span style="color: #000000;">); </span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> ListResult(result); </span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/> }</span></span><span style="color: #000000;"> </span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">finally</span><span style="color: #000000;"> </span><span style="color: #008080;">14</span><span style="color: #000000;"><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_515_558_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_515_558_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_515_558_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_515_558_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_515_558_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_515_558_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_515_558_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_515_558_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_515_558_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesCS.ZipsClient.Cs_Client.Cs_GetPilotsNativeUnoptimized_849_66_515_558_Open_Text"><span style="color: #000000;">{ </span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> oc.Close(); </span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/> }</span></span><span style="color: #000000;"> </span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/> }</span></span></div></pre></div></div> <p></span> </p> <p> <span name="cs_wiki_filter" csw_filters="vb"></p> <div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">Client.vb: <span class="fscMemberName">GetPilotsNativeUnoptimized</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_GetPilotsNativeUnoptimized_994_66"><div><!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><span style="color: #008080;">01</span><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_GetPilotsNativeUnoptimized_994_66_15_457_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_GetPilotsNativeUnoptimized_994_66_15_457_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_GetPilotsNativeUnoptimized_994_66_15_457_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_GetPilotsNativeUnoptimized_994_66_15_457_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_GetPilotsNativeUnoptimized_994_66_15_457_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_GetPilotsNativeUnoptimized_994_66_15_457_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_GetPilotsNativeUnoptimized_994_66_15_457_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_GetPilotsNativeUnoptimized_994_66_15_457_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_GetPilotsNativeUnoptimized_994_66_15_457_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub GetPilotsNativeUnoptimized()</span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_GetPilotsNativeUnoptimized_994_66_15_457_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> GetPilotsNativeUnoptimized() </span><span style="color: #008080;">02</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> Console.WriteLine(</span><span style="color: #800000;">"</span><span style="color: #800000;">Retrieving Pilot objects: Native Query Unoptimized</span><span style="color: #800000;">"</span><span style="color: #000000;">) </span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> oc </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.OpenClient(</span><span style="color: #800000;">"</span><span style="color: #800000;">localhost</span><span style="color: #800000;">"</span><span style="color: #000000;">, </span><span style="color: #000000;">&</span><span style="color: #000000;">HDB40, </span><span style="color: #800000;">"</span><span style="color: #800000;">db4o</span><span style="color: #800000;">"</span><span style="color: #000000;">, </span><span style="color: #800000;">"</span><span style="color: #800000;">db4o</span><span style="color: #800000;">"</span><span style="color: #000000;">) </span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">Try</span><span style="color: #000000;"> </span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> result </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IList(</span><span style="color: #0000FF;">Of</span><span style="color: #000000;"> Pilot) </span><span style="color: #000000;">=</span><span style="color: #000000;"> oc.Query(</span><span style="color: #0000FF;">Of</span><span style="color: #000000;"> Pilot)(</span><span style="color: #0000FF;">AddressOf</span><span style="color: #000000;"> Pilot5Points) </span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> ListResult(result) </span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">Finally</span><span style="color: #000000;"> </span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> oc.Close() </span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">End</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Try</span><span style="color: #000000;"> </span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/> </span><span style="color: #0000FF;">End Sub</span></span></div></pre></div></div><div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">Client.vb: <span class="fscMemberName">PilotEven</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_PilotEven_1060_45"><div><!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><span style="color: #008080;">1</span><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_PilotEven_1060_45_15_129_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_PilotEven_1060_45_15_129_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_PilotEven_1060_45_15_129_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_PilotEven_1060_45_15_129_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_PilotEven_1060_45_15_129_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_PilotEven_1060_45_15_129_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_PilotEven_1060_45_15_129_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_PilotEven_1060_45_15_129_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_PilotEven_1060_45_15_129_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Function PilotEven()</span><span id="ResourcesReferenceClient-ServerServer_Without_Persistent_Classes_DeployednoclassesVB.ZipsClient.Vb_Client.Vb_PilotEven_1060_45_15_129_Open_Text"><span style="color: #0000FF;">Function</span><span style="color: #000000;"> PilotEven(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> pilot </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Pilot) </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Boolean</span><span style="color: #000000;"> </span><span style="color: #008080;">2</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">Return</span><span style="color: #000000;"> pilot.Points </span><span style="color: #0000FF;">Mod</span><span style="color: #000000;"> </span><span style="color: #800080;">2</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">0</span><span style="color: #000000;"> </span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/> </span><span style="color: #0000FF;">End Function</span></span></div></pre></div></div> <br></p> <p></span> </p></div> </div> <div id="footer"> This revision (2) was last Modified 2006-12-30T11:00:53 by Tetyana. </div> </body> </html>