# 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
-----------------------------------------------------------