PoshCode Archive  Artifact Content

Artifact 47576822e120780a7e8f95a60290c1da9d4585a0703c76de580796f3eeefc62d:

  • File datareader-to-dataset.ps1 — part of check-in [66f8b48c56] at 2018-06-10 13:10:22 on branch trunk — Converting datareader to dataset (user: unknown size: 944)

# encoding: ascii
# api: powershell
# title: datareader to dataset
# description: Converting datareader to dataset
# version: 0.1
# type: function
# license: CC0
# x-poshcode-id: 2444
# x-archived: 2011-01-10T08:49:32
#
#
This code was copied from the site http://www.ti4fun.com
-----------------------------------------------------------


Public Function ConvDataReaderToDataTable(Byval command As System.Data.SqlClient.SqlCommand) As System.Data.DataTable
        Dim datatable As New System.Data.DataTable
        Dim reader As System.Data.SqlClient.SqlDataReader = command.ExecuteReader()

        Try

            datatable.Load(reader)

        Finally
            reader.Close()
            command.Connection = Nothing
        End Try

        Return datatable
    End Function




This code was copied from the site http://www.ti4fun.com
-----------------------------------------------------------