﻿<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>Create a Server based SQLConnection to SQL Server</Title>
      <Author>Microsoft Corporation</Author>
      <Description>Creates a SQL Connection providing replacements for the typical connection name/value pairs</Description>
      <Shortcut>adoCreateSqlConn</Shortcut>
    </Header>
    <Snippet>
      <References>
        <Reference>
          <Assembly>System.Data.dll</Assembly>
        </Reference>
        <Reference>
          <Assembly>System.Xml.dll</Assembly>
        </Reference>
      </References>
      <Imports>
        <Import>
          <Namespace>System.Data.SqlClient</Namespace>
        </Import>
        <Import>
          <Namespace>System.Data</Namespace>
        </Import>
      </Imports>
      <Declarations>
        <Literal>
          <ID>conn</ID>
          <Type>SqlConnection</Type>
          <ToolTip>Replace this with the name of the connection object.</ToolTip>
          <Default>conn</Default>
        </Literal>
        <Literal>
          <ID>serverName</ID>
          <Type>String</Type>
          <ToolTip>Replace this with the name of the server.</ToolTip>
          <Default>ServerName</Default>
        </Literal>
        <Literal>
          <ID>dataBaseName</ID>
          <Type>String</Type>
          <ToolTip>Replace this with the name of the database.</ToolTip>
          <Default>Northwind</Default>
        </Literal>
        <Literal>
          <ID>userId</ID>
          <Type>String</Type>
          <ToolTip>Replace this with the user name for connectivity to the database.</ToolTip>
          <Default>&lt;user name&gt;</Default>
        </Literal>
        <Literal>
          <ID>password</ID>
          <Type>String</Type>
          <ToolTip>Replace with the password that corresponds to your user name</ToolTip>
          <Default>&lt;your password&gt;</Default>
        </Literal>
      </Declarations>
      <Code Language="VB"><![CDATA[Dim $conn$ As New SqlConnection()
$conn$.ConnectionString = "Data Source=$serverName$;Initial Catalog=$dataBaseName$;Persist Security Info=True;User ID=$userId$;Password=$password$"]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>