Difference between revisions of "MySQL and PowerShell"

Jump to navigation Jump to search
→‎Connect: Made function names consistent
(Add Google Ads)
(→‎Connect: Made function names consistent)
 
Line 36: Line 36:
Improved connect function with error catcher...
Improved connect function with error catcher...
<source lang="powershell">
<source lang="powershell">
function ConnectMySQL([string]$user, [string]$pass, [string]$MySQLHost, [string]$database) {  
function Connect-MySQL([string]$user, [string]$pass, [string]$MySQLHost, [string]$database) {  
     # Load MySQL .NET Connector Objects  
     # Load MySQL .NET Connector Objects  
     [void][system.reflection.Assembly]::LoadWithPartialName("MySql.Data")  
     [void][system.reflection.Assembly]::LoadWithPartialName("MySql.Data")  
Line 61: Line 61:
</source>
</source>
{{#widget:Widget:GoogleAdSenseSkyscraper}}
{{#widget:Widget:GoogleAdSenseSkyscraper}}
= Commands =
= Commands =
All database operations are done through methods of the <code> MySqlCommand </code> object, the two methods of main interest are...
All database operations are done through methods of the <code> MySqlCommand </code> object, the two methods of main interest are...

Navigation menu