<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>Populate a ComboBox from the Column of a Database Table</Title>
      <Author>Microsoft Corporation</Author>
      <Description>Fills a ComboBox with data from a DataTable object.</Description>
      <Shortcut>cbData</Shortcut>
    </Header>
    <Snippet>
		<References>
			<Reference>
				<Assembly>System.Data.dll</Assembly>
			</Reference>
			<Reference>
				<Assembly>System.Windows.Forms.dll</Assembly>
			</Reference>
			<Reference>
				<Assembly>System.xml</Assembly>
			</Reference>
		</References>
		<Imports>
			<Import>
				<Namespace>System</Namespace>
			</Import>
			<Import>
				<Namespace>Microsoft.VisualBasic</Namespace>
			</Import>
			<Import>
				<Namespace>System.Data</Namespace>
			</Import>
			<Import>
				<Namespace>System.Windows.Forms</Namespace>
			</Import>
		</Imports>
		<Declarations>
		<Object>
			<ID>ComboBoxName</ID>
			<Type>ComboBox</Type>
			<ToolTip>Replace with a ComboxBox on your form.</ToolTip>
			<Default>ComboBox1</Default>
		</Object>
		<Object>
			<ID>table</ID>
			<Type>DataTable</Type>
			<ToolTip>Replace with the DataTable whose column you want to use to populate the ComboBox.</ToolTip>
			<Default>DataTable1</Default>
		</Object>
		<Literal>
			<ID>columnName</ID>
			<Type>String</Type>
			<ToolTip>Replace with the name of the column from the DataTable that you want to use.</ToolTip>
			<Default>"ColumnName"</Default>
		</Literal>
		</Declarations>
      <Code Language="VB" Kind="method body"><![CDATA[Me.$ComboBoxName$.DataSource = $table$
Me.$ComboBoxName$.DisplayMember = $columnName$]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>