Page 1 of 1

Data Sources

Posted: Tue Mar 26, 2013 4:26 am
by nhsaait
When will the Data Sources functionality be available within Primal Forms.

Re: Data Sources

Posted: Tue Mar 26, 2013 8:54 am
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

Re: Data Sources

Posted: Tue Mar 26, 2013 4:28 pm
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.

Re: Data Sources

Posted: Wed Mar 27, 2013 11:50 am
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

Re: Data Sources

Posted: Thu Mar 28, 2013 4:25 am
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...

Re: Data Sources

Posted: Thu Mar 28, 2013 8:57 am
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

Re: Data Sources

Posted: Tue Apr 02, 2013 2:05 am
by nhsaait
Thanks David...