Reading data from Sql Table returning item count with table data
`function read_DB { Param( [Parameter(Mandatory = $true, Position = 0)][string]$query, [Parameter(Mandatory = $true, Position = 1)][System.Data.SqlClient.SqlConnection]$connection, ) $table = New-Object System.Data.DataTable $connection.Open() $command = New-Object System.Data.SqlClient.SqlCommand($query, $connection) $dataAdapter = New-Object System.Data.SqlClient.SqlDataAdapter($command) $dataAdapter.Fill($table) $connection.Close() return $table } **Main** $all_tasks = New-Object ‘System.Collections.ArrayList’ $query = “SELECT * from dbo.SPO_All where Status=’Pending'” $all_tasks = read_DB -query $query -connection […]
Powershell module SimplySQL can not connect to MySQL server with help of PSCredential: “Cannot convert to System.Management.Automation.PSCredential”
I am trying to use SimplySQL example from their wiki, to connect to MySQL Server which is up and running (MySQL Workbench works fine)
MySQL transaction does not work in Powershell script
I have a code which works fine without transaction
Yet, when I try to use code with transaction