Search found 5 matches

by minimen456
Wed Apr 07, 2021 12:45 am
Forum: PowerShell GUIs
Topic: Print results into a textbox in reverse order
Replies: 3
Views: 2380

Re: Print results into a textbox in reverse order

Does nothing, Listbox doesn't display anything: $listbox.Text = "something" I seems You've meant: $texbox1.Text = "$(get-date -Format "hh:mm:ss")" + [Environment]::NewLine + $textbox1.Text Thanks, the solution works. Also it seems I can't copy results to a clipboard fro...
by minimen456
Tue Apr 06, 2021 3:04 pm
Forum: PowerShell GUIs
Topic: Print results into a textbox in reverse order
Replies: 3
Views: 2380

Print results into a textbox in reverse order

Hello, I'd like to print results into a textbox in reverse order. I'm clicking a button and the newer datestamp must be on top. I've tried like this with no success. Is there a proper way? $txtResult.Lines += "$(get-date -Format "hh:mm:ss")" $tmp = $txtResult.Lines [array]::Reve...
by minimen456
Sun Apr 04, 2021 11:41 am
Forum: PowerShell GUIs
Topic: Add a calculated field to result data from a database
Replies: 5
Views: 5845

Re: Add a calculated field to result data from a database

Thanks, I've got the idea. The solution where I create a temporary field in SQL Select statement and then alter it in ForEach-Object cycle is acceptable. Though the sample doesn't work. $rdr doesn't have load method. It seems one suppose to $dt.load($rdr)
by minimen456
Sat Apr 03, 2021 1:30 pm
Forum: PowerShell GUIs
Topic: Add a calculated field to result data from a database
Replies: 5
Views: 5845

Re: Add a calculated field to result data from a database

In this sample $datagridview1 and Out-GridView works: $x = $dataset.Tables[0] $datagridview1.DataSource = $x $x | Out-GridView In this sample $datagridview1 displays nothing, Out-GridView works. $x = $dataset.Tables[0] | select *, @{ n = "calculated_field"; e = { "$($_.calculated_fiel...
by minimen456
Sat Apr 03, 2021 2:26 am
Forum: PowerShell GUIs
Topic: Add a calculated field to result data from a database
Replies: 5
Views: 5845

Add a calculated field to result data from a database

Hello, I would like to add a calculated field to a table I've pulled from a database. I'm using "| Select @{" to build a custom object with a calculated field. I call it the object $x. But when I sent it to ConvertTo-DataTable function it throws an error. Though Out-GridView works fine wit...