<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>WDM - SQL SP Return DS</Title>
      <Shortcut>WDM-SQLSPReturnDS</Shortcut>
      <Description>WDM - SQL SP Return DS [VB.NET]</Description>
      <Author>Daren Hawes</Author>
      <HelpUrl>/PreviewSnippet.aspx?SnippetID=b5f9e733-3b4e-486a-a848-c17b0fecae62</HelpUrl>
      <SnippetTypes>
        <SnippetType>SurroundsWith</SnippetType>
      </SnippetTypes>
    </Header>
    <Snippet>
      <Code Language="VB"><![CDATA[        'Public Function GetPropertyCommit(ByVal PropertyCommitID As Integer) As DataSet
        'SQL Configuration
        Dim SqlCommand As New SqlCommand
        SqlCommand.CommandText = "dbo.Property_GetCommit"
        SqlCommand.CommandType = System.Data.CommandType.StoredProcedure
        SqlCommand.Connection = DatabaseConnection

        'Parameters
        SqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, False, CType(0, Byte), CType(0, Byte), "", System.Data.DataRowVersion.Current, Nothing))
        SqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@PropertyCommitID", System.Data.SqlDbType.Int, 4)).Value = PropertyCommitID

        'Connect to DB and fire
        SqlCommand.Connection.Open()

        Dim daReturnData As New SqlDataAdapter(SqlCommand)
        Dim dsReturnData As New DataSet
        daReturnData.Fill(dsReturnData, "tbl_ReturnData")

        'Close connection
        SqlCommand.Connection.Close()

        Return dsReturnData]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>