Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

ID Element (IntelliSense Code Snippets)

Specifies a unique identifier for a Literal or Object element.

<CodeSnippets>
   <CodeSnippet>
     <Snippet>
       <Declarations>
         <Literal>
           <ID>
             <Object>
               <ID>
<ID>
    Unique Identifier
</ID>

The following sections describe attributes, child elements, and parent elements.

Attributes

None.

Child Elements

None.

Parent Elements

Element

Description

Literal

Defines the literal fields of the code snippet that you can edit.

Object

Defines the object fields of the code snippet that you can edit.

A text value is required.

This text specifies the unique identifier for the object or literal.

No two literals or objects in the same code snippet can have the same text value in their ID elements.

Literals and objects cannot contain an ID element with a value of end. The value $end$ is reserved, and is used to mark the location to place the cursor after the code snippet is inserted.

The following code snippet contains a literal with an ID element value of SQL and an object with an ID element value of Connection. The Code element references the literal and object using these values.

<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
        <Header>
            <Title>Create a data adapter</Title>
            <Description>Creates a SqlDataAdapter object.</Description>
            <Author>Microsoft Corporation</Author>
            <Shortcut>createadapter</Shortcut>
        </Header>
        <Snippet>
            <Declarations>
                <Literal>
                    <ID>SQL</ID>
                    <ToolTip>Replace with a SQL connection string.</ToolTip>
                    <Default>"SQL connection string"</Default>
                </Literal>
                <Object>
                    <ID>Connection</ID>
                    <Type>System.Data.SqlClient.SqlConnection</Type>
                    <ToolTip>Replace with a connection object in your application.</ToolTip>
                    <Default>dcConnection</Default>
                </Object>
            </Declarations>
            <Code Language="CSharp">
                <![CDATA[
                    daCustomers = new SqlClient.SqlDataAdapter();
                    selectCommand = new SqlClient.SqlCommand($SQL$);
                    daCustomers.SelectCommand = selectCommand;
                    daCustomers.SelectCommand.Connection = $Connection$;
                ]]>
            </Code>
        </Snippet>
    </CodeSnippet>
</CodeSnippets>

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.