Data Sources
Re: Data Sources
Can you elaberate? You can bind data to controls using the DataSource property in the editor.
For example:
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 = $arrayDavid
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Data Sources
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...
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.
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
When you drag and drop a database connection or table it will insert a grid and it will insert a query function.
David
David
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Data Sources
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...
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 (43.02 KiB) Viewed 27117 times
Re: Data Sources
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
I will add the request to the wish list.
David
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.