| Server IP : 180.180.241.3 / Your IP : 216.73.216.216 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Program Files (x86)/Microsoft Visual Studio 10.0/VB/Snippets/1033/data/LINQ Queries/ |
Upload File : |
<?xml version="1.0"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Count query results</Title>
<Author>Microsoft Corporation</Author>
<Description>Counts the number of results from a query.</Description>
<Shortcut>qCount</Shortcut>
</Header>
<Snippet>
<References>
<Reference>
<Assembly>System.Core.dll</Assembly>
</Reference>
</References>
<Imports>
<Import>
<Namespace>System.Linq</Namespace>
</Import>
</Imports>
<Declarations>
<Literal>
<ID>queryResult</ID>
<Type>item</Type>
<ToolTip>Replace with the identifier for the query.</ToolTip>
<Default>query</Default>
</Literal>
<Literal>
<ID>item</ID>
<Type>item</Type>
<ToolTip>Replace with the identifier for the range variable that represents an item from your data source.</ToolTip>
<Default>process</Default>
</Literal>
<Literal>
<ID>dataSource</ID>
<Type>String</Type>
<ToolTip>Replace with the identifier for your data source.</ToolTip>
<Default>System.Diagnostics.Process.GetProcesses()</Default>
</Literal>
<Literal>
<ID>field1</ID>
<Type>String</Type>
<ToolTip>Replace with the identifier for the first field you want to retrieve from your source.</ToolTip>
<Default>ProcessName</Default>
</Literal>
<Literal>
<ID>field2</ID>
<Type>String</Type>
<ToolTip>Replace with the identifier for the second field you want to retrieve from your source.</ToolTip>
<Default>MainWindowTitle</Default>
</Literal>
</Declarations>
<Code Language="VB" Kind="method body">
<![CDATA[Dim $queryResult$ = From $item$ In $dataSource$ _
Select $item$.$field1$, $item$.$field2$
Dim count = $queryResult$.Count]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>