Out-DataTable

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
jsira2003@yahoo.com
Posts: 109
Joined: Fri Apr 07, 2017 9:47 am

Out-DataTable

Post by jsira2003@yahoo.com » Fri Oct 19, 2018 6:21 am

When I need a table I always use Chad Miller's out-datatable function. Is there another routine that can be used in lieu of this? Does Sapien have it own datatable function? If so how do you use it?

Thank You,
John

User avatar
jsira2003@yahoo.com
Posts: 109
Joined: Fri Apr 07, 2017 9:47 am

Re: Out-DataTable

Post by jsira2003@yahoo.com » Fri Oct 19, 2018 6:44 am

I want to pass to the function a [system.collections.arraylist]$motorStats and obtain a datatable. I want to store the table in a variable called $dtMotorStats. I tried to use the convertto-datatable function I saw sapien had written and this did not work. Only the out-datatable function appeared to work for the most part with only a few of columns which did not sort correctly in my datagrid. What was interesting is everything sorts correctly in the out-gridview so I know my columns are of the correct datatype.

thanks,
John

User avatar
jvierra
Posts: 13594
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Out-DataTable

Post by jvierra » Fri Oct 19, 2018 9:43 am

ConvertTo-DataTable works to add any collection to a DataGridView and with all other data bound controls. What is happening that makes you think it doesn't work.

What is it that does not sort correctly? Remember that numbers stored as strings will not sort as expected in ay utility or data function.

Locked