<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>DataRow to String</Title>
      <Shortcut>DataRowtoString</Shortcut>
      <Description>DataRow to String [VB.NET]</Description>
      <Author>Dwaine Wright</Author>
      <HelpUrl>/PreviewSnippet.aspx?SnippetID=c71b73ad-af35-47fb-bdea-2f78941f2883</HelpUrl>
      <SnippetTypes>
        <SnippetType>SurroundsWith</SnippetType>
      </SnippetTypes>
    </Header>
    <Snippet>
      <Code Language="VB"><![CDATA[Shared Function RowToString(ByVal SourceRow As DataRow) As String
        Dim SB As New Text.StringBuilder
        If Not SourceRow Is Nothing Then
            Dim SR As DataRow = SourceRow
            Dim ST As DataTable = SR.Table
            Dim SC As DataColumn
            For Each SC In ST.Columns
                Try
                    SB.Append(SC.ColumnName & " = " & SR.Item(SC.ColumnName) & " " & System.Environment.NewLine)
                Catch oEx As Exception
                End Try
            Next
        Else
            SB.Append("SourceRow not available, stacktrace = " & System.Environment.StackTrace)
        End If
        Return SB.ToString.TrimEnd
    End Function]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>