<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>Merge Tables</Title>
      <Shortcut>MergeTables</Shortcut>
      <Description>Merge Tables [VB.NET]</Description>
      <Author>Kuntal Shah</Author>
      <HelpUrl>/PreviewSnippet.aspx?SnippetID=07536c27-40a0-4ec7-896d-038db50d5e0c</HelpUrl>
      <SnippetTypes>
        <SnippetType>SurroundsWith</SnippetType>
      </SnippetTypes>
    </Header>
    <Snippet>
      <Code Language="VB"><![CDATA['MergeTwoTables()
    'It is desttable = srctable + desttable
    Public Shared Sub MergeTwoTables(ByVal p_dt_srctable As DataTable, ByVal p_dt_desttable As DataTable)
        Dim l_int_indexi As Integer
        Try
            'Loop through the source table and import all rows into the destination table.
            For l_int_indexi = 0 To p_dt_srctable.Rows.Count - 1
                p_dt_desttable.ImportRow(p_dt_srctable.Rows(l_int_indexi))
            Next
        Catch ex As Exception
            'send the caught exception to the errorhandler
            MsgBox(ex.Message)
        End Try
    End Sub]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>