Sophie

Sophie

distrib > Fedora > 14 > i386 > by-pkgid > 864d1c3c3cd8df4e3a2692faf8776e05 > files > 947

db4o-doc-7.4-2.fc13.i686.rpm

<html>
  <head>
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>SODA Query API</title>
    <link rel="stylesheet" type="text/css" href="../../../../style.css">
  </head>
  <body>
    <div class="CommonContent">
      <div class="CommonContentArea">
        <h1>SODA Query API</h1><div id="TOC"><div id="TOCinner"><span class="TOCtitle">Contents</span><div class="TOCcontents"><ul><li><a href ="#Not">Not</a></li><li><a href ="#And&nbsp;">And&nbsp;</a></li><li><a href ="#Or&nbsp;">Or&nbsp;</a></li><li><a href ="#Greater, Smaller, Equal &lt;&gt;=">Greater, Smaller, Equal &lt;&gt;=</a></li><li><a href ="#Using Default Values&nbsp;">Using Default Values&nbsp;</a></li><li><a href ="#String Comparisons">String Comparisons</a><ul><li><a href ="#Like&nbsp;">Like&nbsp;</a></li><li><a href ="#startsWith, endsWith&nbsp;">startsWith, endsWith&nbsp;</a></li><li><a href ="#Case Insensitive Queries">Case Insensitive Queries</a></li></ul></li><li><a href ="#Contains&nbsp;">Contains&nbsp;</a></li><li><a href ="#Identity Comparison&nbsp;">Identity Comparison&nbsp;</a></li><li><a href ="#Sorting Results&nbsp;">Sorting Results&nbsp;</a></li></ul></li></ul></div></div></div><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>There are occasions when we don't want to query for exact field values, 
but rather for value ranges, objects not containing given member values, etc. 
This functionality is provided by the Constraint API.</p>
<a name="Not"></a><h3>Not<br></h3>

<p>First, let's negate 
a query to find all pilots who are not Michael Schumacher:</p>



<span name="cs_wiki_filter" csw_filters="cs">

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">QueryExample.cs: <span class="fscMemberName">RetrieveByNegation</span></span></div><div class="fscCode"><pre ID="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByNegation_380_68"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #0000FF;">public</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;"> RetrieveByNegation(IObjectContainer db)
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByNegation_380_68_61_259_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByNegation_380_68_61_259_Open_Text').style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByNegation_380_68_61_259_Closed_Image').style.display='inline'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByNegation_380_68_61_259_Closed_Text').style.display='inline';"/><img id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByNegation_380_68_61_259_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByNegation_380_68_61_259_Closed_Text').style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByNegation_380_68_61_259_Open_Image').style.display='inline'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByNegation_380_68_61_259_Open_Text').style.display='inline';"/>    </span><span id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByNegation_380_68_61_259_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByNegation_380_68_61_259_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IQuery query </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query();
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      query.Constrain(</span><span style="color: #0000FF;">typeof</span><span style="color: #000000;">(Pilot));
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_name</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Michael Schumacher</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Not();
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IObjectSet result </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute();
</span><span style="color: #008080;">7</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      ListResult(result);
</span><span style="color: #008080;">8</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>    }</span></span></div></pre></div></div>

</span>

<span name="cs_wiki_filter" csw_filters="vb">

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">QueryExample.vb: <span class="fscMemberName">RetrieveByNegation</span></span></div><div class="fscCode"><pre ID="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByNegation_512_68"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByNegation_512_68_14_332_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByNegation_512_68_14_332_Open_Text').style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByNegation_512_68_14_332_Closed_Image').style.display='inline'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByNegation_512_68_14_332_Closed_Text').style.display='inline';"/><img id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByNegation_512_68_14_332_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByNegation_512_68_14_332_Closed_Text').style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByNegation_512_68_14_332_Open_Image').style.display='inline'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByNegation_512_68_14_332_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByNegation_512_68_14_332_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub RetrieveByNegation()</span><span id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByNegation_512_68_14_332_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> RetrieveByNegation(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> db </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer)
</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;">Dim</span><span style="color: #000000;"> query </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IQuery </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query()
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            query.Constrain(</span><span style="color: #0000FF;">GetType</span><span style="color: #000000;">(Pilot))
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_name</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Michael Schumacher</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).[</span><span style="color: #0000FF;">Not</span><span style="color: #000000;">]()
</span><span style="color: #008080;">5</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;"> IObjectSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute()
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            ListResult(result)
</span><span style="color: #008080;">7</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>

</span>
<a name="And&nbsp;"></a><h3>And&nbsp;</h3>

<p>Where there is negation, the other boolean operators can't be too far. </p>



<span name="cs_wiki_filter" csw_filters="cs">

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">QueryExample.cs: <span class="fscMemberName">RetrieveByConjunction</span></span></div><div class="fscCode"><pre ID="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByConjunction_750_71"><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;">public</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;"> RetrieveByConjunction(IObjectContainer db)
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByConjunction_750_71_64_342_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByConjunction_750_71_64_342_Open_Text').style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByConjunction_750_71_64_342_Closed_Image').style.display='inline'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByConjunction_750_71_64_342_Closed_Text').style.display='inline';"/><img id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByConjunction_750_71_64_342_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByConjunction_750_71_64_342_Closed_Text').style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByConjunction_750_71_64_342_Open_Image').style.display='inline'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByConjunction_750_71_64_342_Open_Text').style.display='inline';"/>    </span><span id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByConjunction_750_71_64_342_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByConjunction_750_71_64_342_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"/>      IQuery query </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query();
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      query.Constrain(</span><span style="color: #0000FF;">typeof</span><span style="color: #000000;">(Pilot));
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IConstraint constr </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_name</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        .Constrain(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Michael Schumacher</span><span style="color: #800000;">&quot;</span><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"/>      query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_points</span><span style="color: #800000;">&quot;</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"/>        .Constrain(</span><span style="color: #800080;">99</span><span style="color: #000000;">).And(constr);
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IObjectSet result </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute();
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      ListResult(result);
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>    }</span></span></div></pre></div></div>

</span>

<span name="cs_wiki_filter" csw_filters="vb">

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">QueryExample.vb: <span class="fscMemberName">RetrieveByConjunction</span></span></div><div class="fscCode"><pre ID="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByConjunction_885_71"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByConjunction_885_71_14_416_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByConjunction_885_71_14_416_Open_Text').style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByConjunction_885_71_14_416_Closed_Image').style.display='inline'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByConjunction_885_71_14_416_Closed_Text').style.display='inline';"/><img id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByConjunction_885_71_14_416_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByConjunction_885_71_14_416_Closed_Text').style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByConjunction_885_71_14_416_Open_Image').style.display='inline'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByConjunction_885_71_14_416_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByConjunction_885_71_14_416_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub RetrieveByConjunction()</span><span id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByConjunction_885_71_14_416_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> RetrieveByConjunction(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> db </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer)
</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;">Dim</span><span style="color: #000000;"> query </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IQuery </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query()
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            query.Constrain(</span><span style="color: #0000FF;">GetType</span><span style="color: #000000;">(Pilot))
</span><span style="color: #008080;">4</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;"> constr </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Constraint </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_name</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Michael Schumacher</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_points</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(</span><span style="color: #800080;">99</span><span style="color: #000000;">).Or(constr)
</span><span style="color: #008080;">6</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;"> IObjectSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute()
</span><span style="color: #008080;">7</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            ListResult(result)
</span><span style="color: #008080;">8</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>

</span>
<a name="Or&nbsp;"></a><h3>Or&nbsp;</h3>




<span name="cs_wiki_filter" csw_filters="cs">

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">QueryExample.cs: <span class="fscMemberName">RetrieveByDisjunction</span></span></div><div class="fscCode"><pre ID="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByDisjunction_1045_71"><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;">public</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;"> RetrieveByDisjunction(IObjectContainer db)
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByDisjunction_1045_71_64_341_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByDisjunction_1045_71_64_341_Open_Text').style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByDisjunction_1045_71_64_341_Closed_Image').style.display='inline'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByDisjunction_1045_71_64_341_Closed_Text').style.display='inline';"/><img id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByDisjunction_1045_71_64_341_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByDisjunction_1045_71_64_341_Closed_Text').style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByDisjunction_1045_71_64_341_Open_Image').style.display='inline'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByDisjunction_1045_71_64_341_Open_Text').style.display='inline';"/>    </span><span id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByDisjunction_1045_71_64_341_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByDisjunction_1045_71_64_341_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"/>      IQuery query </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query();
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      query.Constrain(</span><span style="color: #0000FF;">typeof</span><span style="color: #000000;">(Pilot));
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IConstraint constr </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_name</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        .Constrain(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Michael Schumacher</span><span style="color: #800000;">&quot;</span><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"/>      query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_points</span><span style="color: #800000;">&quot;</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"/>        .Constrain(</span><span style="color: #800080;">99</span><span style="color: #000000;">).Or(constr);
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IObjectSet result </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute();
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      ListResult(result);
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>    }</span></span></div></pre></div></div>

</span>


<span name="cs_wiki_filter" csw_filters="vb">

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">QueryExample.vb: <span class="fscMemberName">RetrieveByDisjunction</span></span></div><div class="fscCode"><pre ID="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByDisjunction_1182_71"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByDisjunction_1182_71_14_416_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByDisjunction_1182_71_14_416_Open_Text').style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByDisjunction_1182_71_14_416_Closed_Image').style.display='inline'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByDisjunction_1182_71_14_416_Closed_Text').style.display='inline';"/><img id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByDisjunction_1182_71_14_416_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByDisjunction_1182_71_14_416_Closed_Text').style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByDisjunction_1182_71_14_416_Open_Image').style.display='inline'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByDisjunction_1182_71_14_416_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByDisjunction_1182_71_14_416_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub RetrieveByDisjunction()</span><span id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByDisjunction_1182_71_14_416_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> RetrieveByDisjunction(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> db </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer)
</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;">Dim</span><span style="color: #000000;"> query </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IQuery </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query()
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            query.Constrain(</span><span style="color: #0000FF;">GetType</span><span style="color: #000000;">(Pilot))
</span><span style="color: #008080;">4</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;"> constr </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Constraint </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_name</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Michael Schumacher</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_points</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(</span><span style="color: #800080;">99</span><span style="color: #000000;">).Or(constr)
</span><span style="color: #008080;">6</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;"> IObjectSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute()
</span><span style="color: #008080;">7</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            ListResult(result)
</span><span style="color: #008080;">8</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>

</span>
<a name="Greater, Smaller, Equal &lt;&gt;="></a><h3>Greater, Smaller, Equal &lt;&gt;=</h3>

<p>We can also constrain to a comparison with a given value.</p>
<p>Return pilots with more than 99 points:</p>




<span name="cs_wiki_filter" csw_filters="cs">

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">QueryExample.cs: <span class="fscMemberName">RetrieveByComparison</span></span></div><div class="fscCode"><pre ID="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByComparison_1483_70"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #0000FF;">public</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;"> RetrieveByComparison(IObjectContainer db)
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByComparison_1483_70_63_254_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByComparison_1483_70_63_254_Open_Text').style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByComparison_1483_70_63_254_Closed_Image').style.display='inline'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByComparison_1483_70_63_254_Closed_Text').style.display='inline';"/><img id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByComparison_1483_70_63_254_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByComparison_1483_70_63_254_Closed_Text').style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByComparison_1483_70_63_254_Open_Image').style.display='inline'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByComparison_1483_70_63_254_Open_Text').style.display='inline';"/>    </span><span id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByComparison_1483_70_63_254_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByComparison_1483_70_63_254_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IQuery query </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query();
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      query.Constrain(</span><span style="color: #0000FF;">typeof</span><span style="color: #000000;">(Pilot));
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_points</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        .Constrain(</span><span style="color: #800080;">99</span><span style="color: #000000;">).Greater();
</span><span style="color: #008080;">7</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IObjectSet result </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute();
</span><span style="color: #008080;">8</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      ListResult(result);
</span><span style="color: #008080;">9</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>    }</span></span></div></pre></div></div>

</span>


<span name="cs_wiki_filter" csw_filters="vb">

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">QueryExample.vb: <span class="fscMemberName">RetrieveByComparison</span></span></div><div class="fscCode"><pre ID="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByComparison_1619_70"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByComparison_1619_70_14_320_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByComparison_1619_70_14_320_Open_Text').style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByComparison_1619_70_14_320_Closed_Image').style.display='inline'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByComparison_1619_70_14_320_Closed_Text').style.display='inline';"/><img id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByComparison_1619_70_14_320_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByComparison_1619_70_14_320_Closed_Text').style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByComparison_1619_70_14_320_Open_Image').style.display='inline'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByComparison_1619_70_14_320_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByComparison_1619_70_14_320_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub RetrieveByComparison()</span><span id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByComparison_1619_70_14_320_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> RetrieveByComparison(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> db </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer)
</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;">Dim</span><span style="color: #000000;"> query </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IQuery </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query()
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            query.Constrain(</span><span style="color: #0000FF;">GetType</span><span style="color: #000000;">(Pilot))
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_points</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(</span><span style="color: #800080;">99</span><span style="color: #000000;">).Greater()
</span><span style="color: #008080;">5</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;"> IObjectSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute()
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            ListResult(result)
</span><span style="color: #008080;">7</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>

</span>
<p>Return pilots with 99 or more points:</p>




<span name="cs_wiki_filter" csw_filters="cs">

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">QueryExample.cs: <span class="fscMemberName">RetrieveByEqualComparison</span></span></div><div class="fscCode"><pre ID="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByEqualComparison_1805_75"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #0000FF;">public</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;"> RetrieveByEqualComparison(IObjectContainer db)
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByEqualComparison_1805_75_74_336_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByEqualComparison_1805_75_74_336_Open_Text').style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByEqualComparison_1805_75_74_336_Closed_Image').style.display='inline'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByEqualComparison_1805_75_74_336_Closed_Text').style.display='inline';"/><img id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByEqualComparison_1805_75_74_336_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByEqualComparison_1805_75_74_336_Closed_Text').style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByEqualComparison_1805_75_74_336_Open_Image').style.display='inline'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByEqualComparison_1805_75_74_336_Open_Text').style.display='inline';"/>        </span><span id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByEqualComparison_1805_75_74_336_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByEqualComparison_1805_75_74_336_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            IQuery query </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query();
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            query.Constrain(</span><span style="color: #0000FF;">typeof</span><span style="color: #000000;">(Pilot));
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_points</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                .Constrain(</span><span style="color: #800080;">99</span><span style="color: #000000;">).Greater().Equal();
</span><span style="color: #008080;">7</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            IObjectSet result </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute();
</span><span style="color: #008080;">8</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            ListResult(result);
</span><span style="color: #008080;">9</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        }</span></span></div></pre></div></div>

</span>


<span name="cs_wiki_filter" csw_filters="vb">

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">QueryExample.vb: <span class="fscMemberName">RetrieveByEqualComparison</span></span></div><div class="fscCode"><pre ID="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByEqualComparison_1946_75"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">1</span><img id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByEqualComparison_1946_75_14_333_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByEqualComparison_1946_75_14_333_Open_Text').style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByEqualComparison_1946_75_14_333_Closed_Image').style.display='inline'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByEqualComparison_1946_75_14_333_Closed_Text').style.display='inline';"/><img id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByEqualComparison_1946_75_14_333_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByEqualComparison_1946_75_14_333_Closed_Text').style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByEqualComparison_1946_75_14_333_Open_Image').style.display='inline'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByEqualComparison_1946_75_14_333_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByEqualComparison_1946_75_14_333_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub RetrieveByEqualComparison()</span><span id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByEqualComparison_1946_75_14_333_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> RetrieveByEqualComparison(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> db </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer)
</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;">Dim</span><span style="color: #000000;"> query </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IQuery </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query()
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            query.Constrain(</span><span style="color: #0000FF;">GetType</span><span style="color: #000000;">(Pilot))
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_points</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(</span><span style="color: #800080;">99</span><span style="color: #000000;">).Greater().Equal()
</span><span style="color: #008080;">5</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;"> IObjectSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute()
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            ListResult(result)
</span><span style="color: #008080;">7</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>

</span>

<a name="Using Default Values&nbsp;"></a><h3>Using Default Values&nbsp;</h3>

<p>The query API also allows to query for field default values. </p>




<span name="cs_wiki_filter" csw_filters="cs">

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">QueryExample.cs: <span class="fscMemberName">RetrieveByDefaultFieldValue</span></span></div><div class="fscCode"><pre ID="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByDefaultFieldValue_2202_77"><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;">public</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;"> RetrieveByDefaultFieldValue(IObjectContainer db)
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByDefaultFieldValue_2202_77_70_341_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByDefaultFieldValue_2202_77_70_341_Open_Text').style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByDefaultFieldValue_2202_77_70_341_Closed_Image').style.display='inline'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByDefaultFieldValue_2202_77_70_341_Closed_Text').style.display='inline';"/><img id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByDefaultFieldValue_2202_77_70_341_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByDefaultFieldValue_2202_77_70_341_Closed_Text').style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByDefaultFieldValue_2202_77_70_341_Open_Image').style.display='inline'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByDefaultFieldValue_2202_77_70_341_Open_Text').style.display='inline';"/>    </span><span id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByDefaultFieldValue_2202_77_70_341_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveByDefaultFieldValue_2202_77_70_341_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"/>      Pilot somebody </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Somebody else</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">0</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"/>      db.Set(somebody);
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IQuery query </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query();
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      query.Constrain(</span><span style="color: #0000FF;">typeof</span><span style="color: #000000;">(Pilot));
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_points</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(</span><span style="color: #800080;">0</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"/>      IObjectSet result </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute();
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      ListResult(result);
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      db.Delete(somebody);
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>    }</span></span></div></pre></div></div>

</span>


<span name="cs_wiki_filter" csw_filters="vb">

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">QueryExample.vb: <span class="fscMemberName">RetrieveByDefaultFieldValue</span></span></div><div class="fscCode"><pre ID="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByDefaultFieldValue_2345_77"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByDefaultFieldValue_2345_77_14_443_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByDefaultFieldValue_2345_77_14_443_Open_Text').style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByDefaultFieldValue_2345_77_14_443_Closed_Image').style.display='inline'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByDefaultFieldValue_2345_77_14_443_Closed_Text').style.display='inline';"/><img id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByDefaultFieldValue_2345_77_14_443_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByDefaultFieldValue_2345_77_14_443_Closed_Text').style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByDefaultFieldValue_2345_77_14_443_Open_Image').style.display='inline'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByDefaultFieldValue_2345_77_14_443_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByDefaultFieldValue_2345_77_14_443_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub RetrieveByDefaultFieldValue()</span><span id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveByDefaultFieldValue_2345_77_14_443_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> RetrieveByDefaultFieldValue(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> db </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer)
</span><span style="color: #008080;">02</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;"> somebody </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Somebody else</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">0</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"/>            db.Set(somebody)
</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;">Dim</span><span style="color: #000000;"> query </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IQuery </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query()
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            query.Constrain(</span><span style="color: #0000FF;">GetType</span><span style="color: #000000;">(Pilot))
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_points</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(</span><span style="color: #800080;">0</span><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"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> result </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute()
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            ListResult(result)
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            db.Delete(somebody)
</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>

</span>
<a name="String Comparisons"></a><h3>String Comparisons</h3><a name="Like&nbsp;"></a><h4>Like&nbsp;</h4>
<p>This is an equivalent to SQL "like" operator:</p>



<span name="cs_wiki_filter" csw_filters="cs">

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">SodaExample.cs: <span class="fscMemberName">TestLike</span></span></div><div class="fscCode"><pre ID="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54"><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;">public</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;"> TestLike()
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_38_1550_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_38_1550_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_38_1550_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_38_1550_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_38_1550_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_38_1550_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_38_1550_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_38_1550_Open_Text').style.display='inline';"/>        </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_38_1550_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_38_1550_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"/>            File.Delete(Db4oFileName);
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            IObjectContainer container </span><span style="color: #000000;">=</span><span style="color: #000000;"> Database();
</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;">if</span><span style="color: #000000;"> (container </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">)
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_179_1540_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_179_1540_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_179_1540_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_179_1540_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_179_1540_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_179_1540_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_179_1540_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_179_1540_Open_Text').style.display='inline';"/>            </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_179_1540_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_179_1540_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"/>                </span><span style="color: #0000FF;">try</span><span style="color: #000000;">
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_217_1133_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_217_1133_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_217_1133_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_217_1133_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_217_1133_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_217_1133_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_217_1133_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_217_1133_Open_Text').style.display='inline';"/>                </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_217_1133_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_217_1133_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"/>                    Pilot pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Test Pilot1</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">100</span><span style="color: #000000;">);
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    container.Set(pilot);
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Test Pilot2</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">102</span><span style="color: #000000;">);
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    container.Set(pilot);
</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: #008080;">14</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #008000;">//</span><span style="color: #008000;"> Simple.IQuery</span><span style="color: #008000;">
</span><span style="color: #008080;">15</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    IQuery query1 </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Query();
</span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    query1.Constrain(</span><span style="color: #0000FF;">typeof</span><span style="color: #000000;">(Pilot));
</span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    query1.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_name</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">est</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">);
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    IObjectSet result </span><span style="color: #000000;">=</span><span style="color: #000000;"> query1.Execute();
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    ListResult(result);
</span><span style="color: #008080;">20</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">21</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #008000;">//</span><span style="color: #008000;"> Like.IQuery</span><span style="color: #008000;">
</span><span style="color: #008080;">22</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    IQuery query2 </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Query();
</span><span style="color: #008080;">23</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    query2.Constrain(</span><span style="color: #0000FF;">typeof</span><span style="color: #000000;">(Pilot));
</span><span style="color: #008080;">24</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #008000;">//</span><span style="color: #008000;"> All pilots with the name containing &quot;est&quot; will be retrieved</span><span style="color: #008000;">
</span><span style="color: #008080;">25</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    query2.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_name</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">est</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Like();
</span><span style="color: #008080;">26</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    result </span><span style="color: #000000;">=</span><span style="color: #000000;"> query2.Execute();
</span><span style="color: #008080;">27</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    ListResult(result);
</span><span style="color: #008080;">28</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;">29</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">catch</span><span style="color: #000000;"> (Db4oException ex)
</span><span style="color: #008080;">30</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1191_1282_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1191_1282_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1191_1282_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1191_1282_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1191_1282_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1191_1282_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1191_1282_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1191_1282_Open_Text').style.display='inline';"/>                </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1191_1282_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1191_1282_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">31</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Db4o Exception: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> ex.Message);
</span><span style="color: #008080;">32</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;">33</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">catch</span><span style="color: #000000;"> (Exception ex)
</span><span style="color: #008080;">34</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1336_1429_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1336_1429_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1336_1429_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1336_1429_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1336_1429_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1336_1429_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1336_1429_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1336_1429_Open_Text').style.display='inline';"/>                </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1336_1429_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1336_1429_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">35</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">System Exception: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> ex.Message);
</span><span style="color: #008080;">36</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;">37</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;">38</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1470_1526_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1470_1526_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1470_1526_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1470_1526_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1470_1526_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1470_1526_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1470_1526_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1470_1526_Open_Text').style.display='inline';"/>                </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1470_1526_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestLike_2592_54_1470_1526_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">39</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    CloseDatabase();
</span><span style="color: #008080;">40</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;">41</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;">42</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        }</span></span></div></pre></div></div>

</span>


<span name="cs_wiki_filter" csw_filters="vb">

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">SodaExample.vb: <span class="fscMemberName">TestLike</span></span></div><div class="fscCode"><pre ID="....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestLike_2712_54"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img id="....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestLike_2712_54_14_1440_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestLike_2712_54_14_1440_Open_Text').style.display='none'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestLike_2712_54_14_1440_Closed_Image').style.display='inline'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestLike_2712_54_14_1440_Closed_Text').style.display='inline';"/><img id="....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestLike_2712_54_14_1440_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestLike_2712_54_14_1440_Closed_Text').style.display='none'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestLike_2712_54_14_1440_Open_Image').style.display='inline'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestLike_2712_54_14_1440_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestLike_2712_54_14_1440_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub TestLike()</span><span id="....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestLike_2712_54_14_1440_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> TestLike()
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            File.Delete(Db4oFileName)
</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;"> container </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer </span><span style="color: #000000;">=</span><span style="color: #000000;"> Database()
</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;">If</span><span style="color: #000000;"> container </span><span style="color: #0000FF;">IsNot</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Nothing</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Then</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 src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> pilot </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Test Pilot1</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">100</span><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"/>                    container.[</span><span style="color: #0000FF;">Set</span><span style="color: #000000;">](pilot)
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Test Pilot2</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">102</span><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"/>                    container.[</span><span style="color: #0000FF;">Set</span><span style="color: #000000;">](pilot)
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #008000;">'</span><span style="color: #008000;"> Simple.IQuery</span><span style="color: #008000;">
</span><span style="color: #008080;">12</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> query1 </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IQuery </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Query()
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    query1.Constrain(</span><span style="color: #0000FF;">GetType</span><span style="color: #000000;">(Pilot))
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    query1.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_name</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">est</span><span style="color: #800000;">&quot;</span><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"/>                    </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> result </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> query1.Execute()
</span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    ListResult(result)
</span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #008000;">'</span><span style="color: #008000;"> Like.IQuery</span><span style="color: #008000;">
</span><span style="color: #008080;">19</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> query2 </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IQuery </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Query()
</span><span style="color: #008080;">20</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    query2.Constrain(</span><span style="color: #0000FF;">GetType</span><span style="color: #000000;">(Pilot))
</span><span style="color: #008080;">21</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #008000;">'</span><span style="color: #008000;"> All pilots with the name containing &quot;est&quot; will be retrieved</span><span style="color: #008000;">
</span><span style="color: #008080;">22</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    query2.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_name</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">est</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).[Like]()
</span><span style="color: #008080;">23</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    result </span><span style="color: #000000;">=</span><span style="color: #000000;"> query2.Execute()
</span><span style="color: #008080;">24</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    ListResult(result)
</span><span style="color: #008080;">25</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">Catch</span><span style="color: #000000;"> ex </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Db4oException
</span><span style="color: #008080;">26</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Db4o Exception: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> ex.Message)
</span><span style="color: #008080;">27</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">Catch</span><span style="color: #000000;"> ex </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Exception
</span><span style="color: #008080;">28</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">System Exception: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> ex.Message)
</span><span style="color: #008080;">29</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;">30</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    CloseDatabase()
</span><span style="color: #008080;">31</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;">32</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;">If</span><span style="color: #000000;">
</span><span style="color: #008080;">33</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>

</span>
<a name="startsWith, endsWith&nbsp;"></a><h4>startsWith, endsWith&nbsp;</h4>
<p>Compares a beginning or ending of a string:</p>



<span name="cs_wiki_filter" csw_filters="cs">


<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">SodaExample.cs: <span class="fscMemberName">TestStartsEnds</span></span></div><div class="fscCode"><pre ID="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60"><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;">public</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;"> TestStartsEnds()
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_44_1334_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_44_1334_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_44_1334_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_44_1334_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_44_1334_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_44_1334_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_44_1334_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_44_1334_Open_Text').style.display='inline';"/>        </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_44_1334_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_44_1334_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"/>            File.Delete(Db4oFileName);
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            IObjectContainer container </span><span style="color: #000000;">=</span><span style="color: #000000;"> Database();
</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;">if</span><span style="color: #000000;"> (container </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">)
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_185_1324_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_185_1324_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_185_1324_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_185_1324_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_185_1324_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_185_1324_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_185_1324_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_185_1324_Open_Text').style.display='inline';"/>            </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_185_1324_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_185_1324_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"/>                </span><span style="color: #0000FF;">try</span><span style="color: #000000;">
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_223_917_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_223_917_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_223_917_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_223_917_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_223_917_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_223_917_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_223_917_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_223_917_Open_Text').style.display='inline';"/>                </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_223_917_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_223_917_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"/>                    Pilot pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Test Pilot0</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">100</span><span style="color: #000000;">);
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    container.Set(pilot);
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Test Pilot1</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">101</span><span style="color: #000000;">);
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    container.Set(pilot);
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Test Pilot2</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">102</span><span style="color: #000000;">);
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    container.Set(pilot);
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    IQuery query </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Query();
</span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    query.Constrain(</span><span style="color: #0000FF;">typeof</span><span style="color: #000000;">(Pilot));
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_name</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">T0</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).EndsWith(</span><span style="color: #0000FF;">false</span><span style="color: #000000;">).Not();
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #008000;">//</span><span style="color: #008000;">query.Descend(&quot;_name&quot;).Constrain(&quot;Pil&quot;).StartsWith(true);</span><span style="color: #008000;">
</span><span style="color: #008080;">20</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    IObjectSet result </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute();
</span><span style="color: #008080;">21</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    ListResult(result);
</span><span style="color: #008080;">22</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;">23</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">catch</span><span style="color: #000000;"> (Db4oException ex)
</span><span style="color: #008080;">24</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_975_1066_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_975_1066_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_975_1066_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_975_1066_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_975_1066_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_975_1066_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_975_1066_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_975_1066_Open_Text').style.display='inline';"/>                </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_975_1066_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_975_1066_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">25</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Db4o Exception: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> ex.Message);
</span><span style="color: #008080;">26</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;">27</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">catch</span><span style="color: #000000;"> (Exception ex)
</span><span style="color: #008080;">28</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_1120_1213_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_1120_1213_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_1120_1213_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_1120_1213_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_1120_1213_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_1120_1213_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_1120_1213_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_1120_1213_Open_Text').style.display='inline';"/>                </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_1120_1213_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_1120_1213_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">29</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">System Exception: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> ex.Message);
</span><span style="color: #008080;">30</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;">31</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;">32</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_1254_1310_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_1254_1310_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_1254_1310_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_1254_1310_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_1254_1310_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_1254_1310_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_1254_1310_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_1254_1310_Open_Text').style.display='inline';"/>                </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_1254_1310_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestStartsEnds_2925_60_1254_1310_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">33</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    CloseDatabase();
</span><span style="color: #008080;">34</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;">35</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;">36</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        }</span></span></div></pre></div></div>


</span>


<span name="cs_wiki_filter" csw_filters="vb">


<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">SodaExample.vb: <span class="fscMemberName">TestStartsEnds</span></span></div><div class="fscCode"><pre ID="....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestStartsEnds_3055_60"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img id="....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestStartsEnds_3055_60_14_1223_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestStartsEnds_3055_60_14_1223_Open_Text').style.display='none'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestStartsEnds_3055_60_14_1223_Closed_Image').style.display='inline'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestStartsEnds_3055_60_14_1223_Closed_Text').style.display='inline';"/><img id="....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestStartsEnds_3055_60_14_1223_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestStartsEnds_3055_60_14_1223_Closed_Text').style.display='none'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestStartsEnds_3055_60_14_1223_Open_Image').style.display='inline'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestStartsEnds_3055_60_14_1223_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestStartsEnds_3055_60_14_1223_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub TestStartsEnds()</span><span id="....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestStartsEnds_3055_60_14_1223_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> TestStartsEnds()
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            File.Delete(Db4oFileName)
</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;"> container </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer </span><span style="color: #000000;">=</span><span style="color: #000000;"> Database()
</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;">If</span><span style="color: #000000;"> container </span><span style="color: #0000FF;">IsNot</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Nothing</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Then</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 src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> pilot </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Test Pilot0</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">100</span><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"/>                    container.[</span><span style="color: #0000FF;">Set</span><span style="color: #000000;">](pilot)
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Test Pilot1</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">101</span><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"/>                    container.[</span><span style="color: #0000FF;">Set</span><span style="color: #000000;">](pilot)
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Test Pilot2</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">102</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"/>                    container.[</span><span style="color: #0000FF;">Set</span><span style="color: #000000;">](pilot)
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</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;">Dim</span><span style="color: #000000;"> query </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IQuery </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Query()
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    query.Constrain(</span><span style="color: #0000FF;">GetType</span><span style="color: #000000;">(Pilot))
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_name</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">T0</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).EndsWith(</span><span style="color: #0000FF;">False</span><span style="color: #000000;">).[</span><span style="color: #0000FF;">Not</span><span style="color: #000000;">]()
</span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #008000;">'</span><span style="color: #008000;">query.Descend(&quot;_name&quot;).Constrain(&quot;Pil&quot;).StartsWith(true);</span><span style="color: #008000;">
</span><span style="color: #008080;">17</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> result </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute()
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    ListResult(result)
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">Catch</span><span style="color: #000000;"> ex </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Db4oException
</span><span style="color: #008080;">20</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Db4o Exception: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> ex.Message)
</span><span style="color: #008080;">21</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">Catch</span><span style="color: #000000;"> ex </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Exception
</span><span style="color: #008080;">22</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">System Exception: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> ex.Message)
</span><span style="color: #008080;">23</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;">24</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    CloseDatabase()
</span><span style="color: #008080;">25</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;">26</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;">If</span><span style="color: #000000;">
</span><span style="color: #008080;">27</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>


</span>

<a name="Case Insensitive Queries"></a><h4>Case Insensitive Queries</h4><p>By default all string querying
functions use case-sensitive comparison. <code>startsWith</code> and
<code>endsWith</code> allow to switch between comparison modes using a
parameter. However, if you need a case-insensitive comparison for
<code>like</code> , <code>equals</code> or <code>contains</code>
queries, it is recommended to use <a href="../native_queries.html" class="wikiLink">Native Queries</a> as SODA does
not provide such an option.<br></p>
<a name="Contains&nbsp;"></a><h3>Contains&nbsp;</h3>
<p>Allows to retrieve objects constraining by included value (collection). If applied to a string will behave as "Like".</p>



<span name="cs_wiki_filter" csw_filters="cs">


<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">SodaExample.cs: <span class="fscMemberName">TestContains</span></span></div><div class="fscCode"><pre ID="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58"><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;">public</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;"> TestContains()
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_42_1283_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_42_1283_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_42_1283_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_42_1283_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_42_1283_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_42_1283_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_42_1283_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_42_1283_Open_Text').style.display='inline';"/>        </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_42_1283_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_42_1283_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"/>            File.Delete(Db4oFileName);
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            IObjectContainer container </span><span style="color: #000000;">=</span><span style="color: #000000;"> Database();
</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;">if</span><span style="color: #000000;"> (container </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">)
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_183_1273_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_183_1273_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_183_1273_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_183_1273_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_183_1273_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_183_1273_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_183_1273_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_183_1273_Open_Text').style.display='inline';"/>            </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_183_1273_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_183_1273_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"/>                </span><span style="color: #0000FF;">try</span><span style="color: #000000;">
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_221_866_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_221_866_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_221_866_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_221_866_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_221_866_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_221_866_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_221_866_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_221_866_Open_Text').style.display='inline';"/>                </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_221_866_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_221_866_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"/>                    ArrayList list </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> ArrayList();
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    Pilot pilot1 </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Test 1</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">1</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"/>                    list.Add(pilot1);
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    Pilot pilot2 </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Test 2</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">2</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"/>                    list.Add(pilot2);
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    Team team </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Team(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Ferrari</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, list);
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    container.Set(team);
</span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    IQuery query </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Query();
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    query.Constrain(</span><span style="color: #0000FF;">typeof</span><span style="color: #000000;">(Team));
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_pilots</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(pilot2).Contains();
</span><span style="color: #008080;">20</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    IObjectSet result </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute();
</span><span style="color: #008080;">21</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    ListResult(result);
</span><span style="color: #008080;">22</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;">23</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">catch</span><span style="color: #000000;"> (Db4oException ex)
</span><span style="color: #008080;">24</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_924_1015_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_924_1015_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_924_1015_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_924_1015_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_924_1015_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_924_1015_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_924_1015_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_924_1015_Open_Text').style.display='inline';"/>                </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_924_1015_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_924_1015_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">25</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Db4o Exception: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> ex.Message);
</span><span style="color: #008080;">26</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;">27</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">catch</span><span style="color: #000000;"> (Exception ex)
</span><span style="color: #008080;">28</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_1069_1162_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_1069_1162_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_1069_1162_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_1069_1162_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_1069_1162_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_1069_1162_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_1069_1162_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_1069_1162_Open_Text').style.display='inline';"/>                </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_1069_1162_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_1069_1162_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">29</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">System Exception: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> ex.Message);
</span><span style="color: #008080;">30</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;">31</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;">32</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_1203_1259_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_1203_1259_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_1203_1259_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_1203_1259_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_1203_1259_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_1203_1259_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_1203_1259_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_1203_1259_Open_Text').style.display='inline';"/>                </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_1203_1259_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestContains_3793_58_1203_1259_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">33</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    CloseDatabase();
</span><span style="color: #008080;">34</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;">35</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;">36</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        }</span></span></div></pre></div></div>


</span>


<span name="cs_wiki_filter" csw_filters="vb">


<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">SodaExample.vb: <span class="fscMemberName">TestContains</span></span></div><div class="fscCode"><pre ID="....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestContains_3921_58"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img id="....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestContains_3921_58_14_1160_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestContains_3921_58_14_1160_Open_Text').style.display='none'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestContains_3921_58_14_1160_Closed_Image').style.display='inline'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestContains_3921_58_14_1160_Closed_Text').style.display='inline';"/><img id="....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestContains_3921_58_14_1160_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestContains_3921_58_14_1160_Closed_Text').style.display='none'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestContains_3921_58_14_1160_Open_Image').style.display='inline'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestContains_3921_58_14_1160_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestContains_3921_58_14_1160_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub TestContains()</span><span id="....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestContains_3921_58_14_1160_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> TestContains()
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            File.Delete(Db4oFileName)
</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;"> container </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer </span><span style="color: #000000;">=</span><span style="color: #000000;"> Database()
</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;">If</span><span style="color: #000000;"> container </span><span style="color: #0000FF;">IsNot</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Nothing</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Then</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 src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> list </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> ArrayList()
</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;">Dim</span><span style="color: #000000;"> pilot1 </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Test 1</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">1</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"/>                    list.Add(pilot1)
</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;">Dim</span><span style="color: #000000;"> pilot2 </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Test 2</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">2</span><span style="color: #000000;">)
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    list.Add(pilot2)
</span><span style="color: #008080;">11</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;"> team </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Team(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Ferrari</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, list)
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    container.[</span><span style="color: #0000FF;">Set</span><span style="color: #000000;">](team)
</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: #008080;">14</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;"> query </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IQuery </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Query()
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    query.Constrain(</span><span style="color: #0000FF;">GetType</span><span style="color: #000000;">(Team))
</span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_pilots</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(pilot2).Contains()
</span><span style="color: #008080;">17</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;"> IObjectSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute()
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    ListResult(result)
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">Catch</span><span style="color: #000000;"> ex </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Db4oException
</span><span style="color: #008080;">20</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Db4o Exception: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> ex.Message)
</span><span style="color: #008080;">21</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">Catch</span><span style="color: #000000;"> ex </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Exception
</span><span style="color: #008080;">22</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">System Exception: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> ex.Message)
</span><span style="color: #008080;">23</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;">24</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    CloseDatabase()
</span><span style="color: #008080;">25</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;">26</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;">If</span><span style="color: #000000;">
</span><span style="color: #008080;">27</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>


</span>
<a name="Identity Comparison&nbsp;"></a><h3>Identity Comparison&nbsp;</h3>
<p>db4o database identity can also be used as a constraint. In this
case only objects with the same database instance will be retrieved:</p>




<span name="cs_wiki_filter" csw_filters="cs">


<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">SodaExample.cs: <span class="fscMemberName">TestIdentity</span></span></div><div class="fscCode"><pre ID="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58"><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;">public</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;"> TestIdentity()
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_42_1894_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_42_1894_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_42_1894_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_42_1894_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_42_1894_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_42_1894_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_42_1894_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_42_1894_Open_Text').style.display='inline';"/>        </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_42_1894_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_42_1894_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"/>            File.Delete(Db4oFileName);
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            IObjectContainer container </span><span style="color: #000000;">=</span><span style="color: #000000;"> Database();
</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;">if</span><span style="color: #000000;"> (container </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">)
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_183_1884_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_183_1884_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_183_1884_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_183_1884_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_183_1884_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_183_1884_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_183_1884_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_183_1884_Open_Text').style.display='inline';"/>            </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_183_1884_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_183_1884_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"/>                </span><span style="color: #0000FF;">try</span><span style="color: #000000;">
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_221_1477_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_221_1477_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_221_1477_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_221_1477_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_221_1477_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_221_1477_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_221_1477_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_221_1477_Open_Text').style.display='inline';"/>                </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_221_1477_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_221_1477_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"/>                    Pilot pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Test Pilot1</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">100</span><span style="color: #000000;">);
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    Car car </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Car(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">BMW</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, pilot);
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    container.Set(car);
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #008000;">//</span><span style="color: #008000;"> Change the name, the pilot instance stays the same</span><span style="color: #008000;">
</span><span style="color: #008080;">13</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    pilot.Name </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Test Pilot2</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #008000;">//</span><span style="color: #008000;"> create a new car</span><span style="color: #008000;">
</span><span style="color: #008080;">15</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    car </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Car(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Ferrari</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, pilot);
</span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    container.Set(car);
</span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #008000;">//</span><span style="color: #008000;"> Simple query: </span><span style="color: #008000;">
</span><span style="color: #008080;">19</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    IQuery query1 </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Query();
</span><span style="color: #008080;">20</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    query1.Constrain(</span><span style="color: #0000FF;">typeof</span><span style="color: #000000;">(Car));
</span><span style="color: #008080;">21</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    query1.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_pilot</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(pilot);
</span><span style="color: #008080;">22</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    IObjectSet result </span><span style="color: #000000;">=</span><span style="color: #000000;"> query1.Execute();
</span><span style="color: #008080;">23</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    ListResult(result);
</span><span style="color: #008080;">24</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">25</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #008000;">//</span><span style="color: #008000;"> identity.IQuery:</span><span style="color: #008000;">
</span><span style="color: #008080;">26</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    IQuery query2 </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Query();
</span><span style="color: #008080;">27</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    query2.Constrain(</span><span style="color: #0000FF;">typeof</span><span style="color: #000000;">(Car));
</span><span style="color: #008080;">28</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #008000;">//</span><span style="color: #008000;"> All cars having pilot with the same Database identity
</span><span style="color: #008080;">29</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #008000;">//</span><span style="color: #008000;"> will be retrieved. As we only created Pilot object once
</span><span style="color: #008080;">30</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #008000;">//</span><span style="color: #008000;"> it should mean all car objects</span><span style="color: #008000;">
</span><span style="color: #008080;">31</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    query2.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_pilot</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(pilot).Identity();
</span><span style="color: #008080;">32</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    result </span><span style="color: #000000;">=</span><span style="color: #000000;"> query2.Execute();
</span><span style="color: #008080;">33</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    ListResult(result);
</span><span style="color: #008080;">34</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;">35</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">catch</span><span style="color: #000000;"> (Db4oException ex)
</span><span style="color: #008080;">36</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1535_1626_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1535_1626_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1535_1626_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1535_1626_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1535_1626_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1535_1626_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1535_1626_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1535_1626_Open_Text').style.display='inline';"/>                </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1535_1626_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1535_1626_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">37</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Db4o Exception: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> ex.Message);
</span><span style="color: #008080;">38</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;">39</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">catch</span><span style="color: #000000;"> (Exception ex)
</span><span style="color: #008080;">40</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1680_1773_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1680_1773_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1680_1773_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1680_1773_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1680_1773_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1680_1773_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1680_1773_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1680_1773_Open_Text').style.display='inline';"/>                </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1680_1773_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1680_1773_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">41</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">System Exception: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> ex.Message);
</span><span style="color: #008080;">42</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;">43</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;">44</span><span style="color: #000000;"><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1814_1870_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1814_1870_Open_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1814_1870_Closed_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1814_1870_Closed_Text').style.display='inline';"/><img id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1814_1870_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1814_1870_Closed_Text').style.display='none'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1814_1870_Open_Image').style.display='inline'; document.getElementById('....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1814_1870_Open_Text').style.display='inline';"/>                </span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1814_1870_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....SodaCS.ZipsSodaExample.Cs_SodaExample.Cs_TestIdentity_4232_58_1814_1870_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">45</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    CloseDatabase();
</span><span style="color: #008080;">46</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;">47</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;">48</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        }</span></span></div></pre></div></div>


</span>



<span name="cs_wiki_filter" csw_filters="vb">


<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">SodaExample.vb: <span class="fscMemberName">TestIdentity</span></span></div><div class="fscCode"><pre ID="....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestIdentity_4362_58"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img id="....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestIdentity_4362_58_14_1777_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestIdentity_4362_58_14_1777_Open_Text').style.display='none'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestIdentity_4362_58_14_1777_Closed_Image').style.display='inline'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestIdentity_4362_58_14_1777_Closed_Text').style.display='inline';"/><img id="....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestIdentity_4362_58_14_1777_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestIdentity_4362_58_14_1777_Closed_Text').style.display='none'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestIdentity_4362_58_14_1777_Open_Image').style.display='inline'; document.getElementById('....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestIdentity_4362_58_14_1777_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestIdentity_4362_58_14_1777_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub TestIdentity()</span><span id="....SodaVB.ZipsSodaExample.Vb_SodaExample.Vb_TestIdentity_4362_58_14_1777_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> TestIdentity()
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            File.Delete(Db4oFileName)
</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;"> container </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer </span><span style="color: #000000;">=</span><span style="color: #000000;"> Database()
</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;">If</span><span style="color: #000000;"> container </span><span style="color: #0000FF;">IsNot</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Nothing</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Then</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 src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> pilot </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Test Pilot1</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">100</span><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"/>                    </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> car </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Car(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">BMW</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, pilot)
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    container.[</span><span style="color: #0000FF;">Set</span><span style="color: #000000;">](car)
</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: #008000;">'</span><span style="color: #008000;"> Change the name, the pilot instance stays the same</span><span style="color: #008000;">
</span><span style="color: #008080;">10</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    pilot.Name </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Test Pilot2</span><span style="color: #800000;">&quot;</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"/>                    </span><span style="color: #008000;">'</span><span style="color: #008000;"> create a new car</span><span style="color: #008000;">
</span><span style="color: #008080;">12</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    car </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Car(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Ferrari</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, pilot)
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    container.[</span><span style="color: #0000FF;">Set</span><span style="color: #000000;">](car)
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #008000;">'</span><span style="color: #008000;"> Simple query: </span><span style="color: #008000;">
</span><span style="color: #008080;">16</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> query1 </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IQuery </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Query()
</span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    query1.Constrain(</span><span style="color: #0000FF;">GetType</span><span style="color: #000000;">(Car))
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    query1.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_pilot</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(pilot)
</span><span style="color: #008080;">19</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;"> IObjectSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> query1.Execute()
</span><span style="color: #008080;">20</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    ListResult(result)
</span><span style="color: #008080;">21</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">22</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #008000;">'</span><span style="color: #008000;"> identity.IQuery:</span><span style="color: #008000;">
</span><span style="color: #008080;">23</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> query2 </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IQuery </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Query()
</span><span style="color: #008080;">24</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    query2.Constrain(</span><span style="color: #0000FF;">GetType</span><span style="color: #000000;">(Car))
</span><span style="color: #008080;">25</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #008000;">'</span><span style="color: #008000;"> All cars having pilot with the same Database identity</span><span style="color: #008000;">
</span><span style="color: #008080;">26</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    </span><span style="color: #008000;">'</span><span style="color: #008000;"> will be retrieved. As we only created Pilot object once</span><span style="color: #008000;">
</span><span style="color: #008080;">27</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    </span><span style="color: #008000;">'</span><span style="color: #008000;"> it should mean all car objects</span><span style="color: #008000;">
</span><span style="color: #008080;">28</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    query2.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_pilot</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(pilot).Identity()
</span><span style="color: #008080;">29</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    result </span><span style="color: #000000;">=</span><span style="color: #000000;"> query2.Execute()
</span><span style="color: #008080;">30</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    ListResult(result)
</span><span style="color: #008080;">31</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">Catch</span><span style="color: #000000;"> ex </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Db4oException
</span><span style="color: #008080;">32</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Db4o Exception: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> ex.Message)
</span><span style="color: #008080;">33</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">Catch</span><span style="color: #000000;"> ex </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Exception
</span><span style="color: #008080;">34</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">System Exception: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> ex.Message)
</span><span style="color: #008080;">35</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;">36</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    CloseDatabase()
</span><span style="color: #008080;">37</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;">38</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;">If</span><span style="color: #000000;">
</span><span style="color: #008080;">39</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>


</span>


<a name="Sorting Results&nbsp;"></a><h3>Sorting Results&nbsp;</h3>

<p>It is also possible to have db4o sort the results.</p>




<span name="cs_wiki_filter" csw_filters="cs">

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">QueryExample.cs: <span class="fscMemberName">RetrieveSorted</span></span></div><div class="fscCode"><pre ID="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveSorted_4589_64"><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;">public</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;"> RetrieveSorted(IObjectContainer db)
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveSorted_4589_64_57_331_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveSorted_4589_64_57_331_Open_Text').style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveSorted_4589_64_57_331_Closed_Image').style.display='inline'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveSorted_4589_64_57_331_Closed_Text').style.display='inline';"/><img id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveSorted_4589_64_57_331_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveSorted_4589_64_57_331_Closed_Text').style.display='none'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveSorted_4589_64_57_331_Open_Image').style.display='inline'; document.getElementById('....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveSorted_4589_64_57_331_Open_Text').style.display='inline';"/>    </span><span id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveSorted_4589_64_57_331_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....QueriesCS.ZipsQueryExample.Cs_QueryExample.Cs_RetrieveSorted_4589_64_57_331_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"/>      IQuery query </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query();
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      query.Constrain(</span><span style="color: #0000FF;">typeof</span><span style="color: #000000;">(Pilot));
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_name</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).OrderAscending();
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IObjectSet result </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute();
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      ListResult(result);
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_name</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).OrderDescending();
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      result </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute();
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      ListResult(result);
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>    }</span></span></div></pre></div></div>

</span>


<span name="cs_wiki_filter" csw_filters="vb">

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">QueryExample.vb: <span class="fscMemberName">RetrieveSorted</span></span></div><div class="fscCode"><pre ID="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveSorted_4719_64"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveSorted_4719_64_14_426_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveSorted_4719_64_14_426_Open_Text').style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveSorted_4719_64_14_426_Closed_Image').style.display='inline'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveSorted_4719_64_14_426_Closed_Text').style.display='inline';"/><img id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveSorted_4719_64_14_426_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveSorted_4719_64_14_426_Closed_Text').style.display='none'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveSorted_4719_64_14_426_Open_Image').style.display='inline'; document.getElementById('....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveSorted_4719_64_14_426_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveSorted_4719_64_14_426_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub RetrieveSorted()</span><span id="....QueriesVB.ZipsQueryExample.Vb_QueryExample.Vb_RetrieveSorted_4719_64_14_426_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> RetrieveSorted(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> db </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer)
</span><span style="color: #008080;">02</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;"> query </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IQuery </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query()
</span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            query.Constrain(</span><span style="color: #0000FF;">GetType</span><span style="color: #000000;">(Pilot))
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_name</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).OrderAscending()
</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;"> IObjectSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute()
</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"/>            query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_name</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).OrderDescending()
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            result </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute()
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            ListResult(result)
</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>

</span>

<p>All these techniques can be combined arbitrarily, of course. Please try it out. 
There still may be cases left where the predefined query API constraints may not 
be sufficient - don't worry, you can always let db4o run any arbitrary code that 
you provide in an Evaluation. Evaluations will be discussed in a <a href="../soda_evaluations.html" class="wikiLink">Evaluations chapter</a>.<br></p></div>
    </div>
    <div id="footer">
					This revision (1) was last Modified 2008-03-02T14:36:11 by Tetyana.
				</div>
  </body>
</html>