Data Sources

Archived support forum for customers who once purchased a PrimalForms product license. This forum is locked.
User avatar
nhsaait
Posts: 4
Joined: Sun Mar 03, 2013 12:44 pm

Data Sources

Post by nhsaait »

When will the Data Sources functionality be available within Primal Forms.

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Data Sources

Post by davidc »

Can you elaberate? You can bind data to controls using the DataSource property in the editor.

For example:
PowerShell Code
Double-click the code block to select all.
$results = Get-WmiObject Win32_Process
#Convert to ArrayList so we can Data Bind the results	 
$array = New-Object System.Collections.ArrayList
$array.AddRange($results)
$datagridviewResults.DataSource = $array
David
David
SAPIEN Technologies, Inc.

User avatar
nhsaait
Posts: 4
Joined: Sun Mar 03, 2013 12:44 pm

Re: Data Sources

Post by nhsaait »

Sorry i should have been more specific...

I want to bind Data to a datagridview direct from a MSSQL database. I can do it by inserting code like...

Code: Select all

	
#Database Query
$QueryString = "select LastUpdateDetect, LastUpdateDownload, LastUpdateInstall, TimeLastChecked from dbo.Pending_Updates_Counts where ClientName = " + "'" + $Hostname + "'"

#Database Connection String
$ConnectionString = 'Data Source=$SQLSERVER;Initial Catalog=Client_Info;Integrated Security=True;User ID=;Password='
	
$command = New-Object System.Data.SqlClient.SqlCommand ($QueryString,$ConnectionString)
$adapter = New-Object System.Data.SqlClient.SqlDataAdapter ($command)


I would rather just be able to drag the Table from the database browser and then add the Data Source info from the DataGridView Tasks menu... The Choose Data Source option says "none" and there is no where to add a source.

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Data Sources

Post by davidc »

When you drag and drop a database connection or table it will insert a grid and it will insert a query function.

David
David
SAPIEN Technologies, Inc.

User avatar
nhsaait
Posts: 4
Joined: Sun Mar 03, 2013 12:44 pm

Re: Data Sources

Post by nhsaait »

Hi David... Thanks for the replies...

I see that it does create the function for me when dragging a table over however there still seems to be some functionality missing. See below...
Attachments
form.jpg
form.jpg (43.02 KiB) Viewed 13725 times

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Data Sources

Post by davidc »

Note: The source does not appear in the designer. You need only call the function it will handle the binding when the script is ran.

I will add the request to the wish list.

David
David
SAPIEN Technologies, Inc.

User avatar
nhsaait
Posts: 4
Joined: Sun Mar 03, 2013 12:44 pm

Re: Data Sources

Post by nhsaait »

Thanks David...