Return to site

Primalforms Download

broken image


Lets get right to the point… Download this great from Sapien the 'PrimalForms Community Edition'. Its free and with a little extra work, you can add value to your scripts. In this sample I'm adding a Windows GUI to one of my demo SQL SMO script to backup a database.

PrimalForms.exe is the programs's main file and it takes circa 765.42 KB (783792 bytes) on disk. The following executables are contained in PrimalForms Community. They take 999.34 KB (1023328 bytes) on disk. PrimalForms.exe (765.42 KB). Nov 01, 2008 The PrimalForms CE no longer has any valid links to it. I heard you can get the Powershell gui visual studio plugin to work on the VS express edition but I have not tried it as I did purchase Powershell Studio 2014. I searched so a lot for good powershell gui tools, even looked for free at first, and found the the PS Studio was by far the best.

Here's the original script:

Add-Type -Assembly 'Microsoft.SqlServer.Smo' | Out-Null

$bkp.Devices.AddDevice('c:tempxdeveloper.bak', 'file');
$bkp.Database = 'Developer';
$bkp.Action = 'Database';
$bkp.Initialize = $true;
$bkp.SQLBackup($svr);

Download
Download

Primalforms Download App

But, by adding a GUI interface and with some extra work, I can make it more flexible. This way I can reuse this script to backup any database from any server. Of course, keep in mind, you need use the right SMO assembly for this script to work. But, for now, we only going to use 'Microsoft.SqlServer.Smo' and not the 'Microsoft.SqlServer.SmoExtended'.

I build my simple Windows GUI so I can extend my script so I can type my required parameters to do my database backup. So I use PrimalForms:

I need to create a GUI with three text fields to pass some information and a button to execute my code. During this process there will be some very basic validation. Here's how the form will look like:

After the form is completed, then at the tool bar you click on the 'Export PowerShell':

This option will allow you to build the forms code so you can send it to three areas:

1. Sapien 'PrimalScript' Editor.
2. Send to Clipboard.
3. Send to a file.

Primalforms

Primal Forms Download Free

After the export, make sure you name the file. Now, with my editor, I need to look for the section of the 'Button_OnClick' so I can add both the validation and the SMO backup code.

#———————————————-
#Generated Event Script Blocks
#———————————————-
#Provide Custom Code for events specified in PrimalForms.
$button1_OnClick=
{
#TODO: Place custom script here

# Storing values to textboxes
[string] $SQLServer = $textBox1.text
[string] $DbName = $textBox2.text
[string] $BkPathName = $textBox3.text

# Simple textboxes validations look for empty values
if ( $SQLServer -eq '){
$Allfields = '1. '+$SQLServer
[system.Windows.forms.MessageBox]::Show($Allfields+'`r`n'+'Invalid entry or blank not allow!!')
$Pass1 = $false;}
else {
$Pass1 = $true;
}
if ( $DbName -eq '){
$Allfields = '1. '+$textBox1.text+'`r`n'+'2. '+$DbName+'`r`n'
[system.Windows.forms.MessageBox]::Show($Allfields+'`r`n'+'Invalid entry or blank not allow!!')
$Pass1 = $false;}
else {
$Pass1 = $true;
}

if ( $BkPathName -eq '){
$Allfields = '1. '+$SQLServer+'`r`n'+'2. '+$DbName+'`r`n'+'3. '+$BkPathName
[system.Windows.forms.MessageBox]::Show($Allfields+'`r`n'+'Invalid entry or blank not allow!!')
$Pass1 = $false;}
else {
$Pass1 = $true;
}

Scanmaster

# If pass validation then execute the backup and verify that the backup file exist
if ($Pass1 -eq $true){
Add-Type -Assembly 'Microsoft.SqlServer.Smo' | Out-Null
#[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.Smo')
$svr = New-Object Microsoft.SqlServer.Management.Smo.server $SQLServer;
$bkp = New-Object Microsoft.SqlServer.Management.Smo.Backup;
$sqlBkupFullpathName = $BkPathName+'x'+$DbName+'.bak'
$bkp.Devices.AddDevice($sqlBkupFullpathName, 'file');
$bkp.Database = $DbName;
$bkp.Action = 'Database';
$bkp.Initialize = $true;
$bkp.SQLBackup($svr);}
if (Test-Path $sqlBkupFullpathName){
[system.Windows.forms.MessageBox]::Show('Backup $sqlBkupFullpathName is done!')
}
else {
$Allfields = '1. '+$SQLServer+'`r`n'+'2. '+$DbName+'`r`n'+'3. '+$BkPathName
[system.Windows.forms.MessageBox]::Show($Allfields+'`r`n'+'Backup Error…')
}
}

Again, this script still have room evolve more and the you can keep extending the power of PowerShell with .NET framework. A simple sample is the use of '… [system.Windows.forms.MessageBox]::Show('Test message here') …' so that a windows message box will popup. Now, we finally completed our simple database backup GUI application.

Download

Primalforms Download App

But, by adding a GUI interface and with some extra work, I can make it more flexible. This way I can reuse this script to backup any database from any server. Of course, keep in mind, you need use the right SMO assembly for this script to work. But, for now, we only going to use 'Microsoft.SqlServer.Smo' and not the 'Microsoft.SqlServer.SmoExtended'.

I build my simple Windows GUI so I can extend my script so I can type my required parameters to do my database backup. So I use PrimalForms:

I need to create a GUI with three text fields to pass some information and a button to execute my code. During this process there will be some very basic validation. Here's how the form will look like:

After the form is completed, then at the tool bar you click on the 'Export PowerShell':

This option will allow you to build the forms code so you can send it to three areas:

1. Sapien 'PrimalScript' Editor.
2. Send to Clipboard.
3. Send to a file.

Primal Forms Download Free

After the export, make sure you name the file. Now, with my editor, I need to look for the section of the 'Button_OnClick' so I can add both the validation and the SMO backup code.

#———————————————-
#Generated Event Script Blocks
#———————————————-
#Provide Custom Code for events specified in PrimalForms.
$button1_OnClick=
{
#TODO: Place custom script here

# Storing values to textboxes
[string] $SQLServer = $textBox1.text
[string] $DbName = $textBox2.text
[string] $BkPathName = $textBox3.text

# Simple textboxes validations look for empty values
if ( $SQLServer -eq '){
$Allfields = '1. '+$SQLServer
[system.Windows.forms.MessageBox]::Show($Allfields+'`r`n'+'Invalid entry or blank not allow!!')
$Pass1 = $false;}
else {
$Pass1 = $true;
}
if ( $DbName -eq '){
$Allfields = '1. '+$textBox1.text+'`r`n'+'2. '+$DbName+'`r`n'
[system.Windows.forms.MessageBox]::Show($Allfields+'`r`n'+'Invalid entry or blank not allow!!')
$Pass1 = $false;}
else {
$Pass1 = $true;
}

if ( $BkPathName -eq '){
$Allfields = '1. '+$SQLServer+'`r`n'+'2. '+$DbName+'`r`n'+'3. '+$BkPathName
[system.Windows.forms.MessageBox]::Show($Allfields+'`r`n'+'Invalid entry or blank not allow!!')
$Pass1 = $false;}
else {
$Pass1 = $true;
}

# If pass validation then execute the backup and verify that the backup file exist
if ($Pass1 -eq $true){
Add-Type -Assembly 'Microsoft.SqlServer.Smo' | Out-Null
#[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.Smo')
$svr = New-Object Microsoft.SqlServer.Management.Smo.server $SQLServer;
$bkp = New-Object Microsoft.SqlServer.Management.Smo.Backup;
$sqlBkupFullpathName = $BkPathName+'x'+$DbName+'.bak'
$bkp.Devices.AddDevice($sqlBkupFullpathName, 'file');
$bkp.Database = $DbName;
$bkp.Action = 'Database';
$bkp.Initialize = $true;
$bkp.SQLBackup($svr);}
if (Test-Path $sqlBkupFullpathName){
[system.Windows.forms.MessageBox]::Show('Backup $sqlBkupFullpathName is done!')
}
else {
$Allfields = '1. '+$SQLServer+'`r`n'+'2. '+$DbName+'`r`n'+'3. '+$BkPathName
[system.Windows.forms.MessageBox]::Show($Allfields+'`r`n'+'Backup Error…')
}
}

Again, this script still have room evolve more and the you can keep extending the power of PowerShell with .NET framework. A simple sample is the use of '… [system.Windows.forms.MessageBox]::Show('Test message here') …' so that a windows message box will popup. Now, we finally completed our simple database backup GUI application.

Make sure you get SMO and PrimalForms installed and feel free to download the script: MyDbBackup.ps1

(Please rename file to a *.ps1)

For more information:

PrimalForms Community Edition and other tools – http://www.primaltools.com/downloads/communitytools/

Autocad 2017 serial key. Microsoft SQL Server SMO downloads:

For SQL Server 2005: http://www.microsoft.com/downloads/details.aspx?FamilyID=d09c1d60-a13c-4479-9b91-9e8b9d835cdc&displaylang=en

Primalforms Download Torrent

For SQL Server 2008: http://www.microsoft.com/downloads/details.aspx?FamilyId=228DE03F-3B5A-428A-923F-58A033D316E1&displaylang=en





broken image