LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using SQL to filling a listbox

Hi,
I want use a listbox to make query to a database. The database consists of table FRIENDS with such fields like f.e. "name", "surname", "address", "age" and so on.
With query "SELECT DISTINCT Friends.Name FROM Friends" I can get unique names that should be included in the listbox. When new name will be added to the table, the listbox should be updated as well.
My problem is that result of "SELECT DISTINCT" query is a 2D array that is not accepted by listbox.
Can somebody help me, please?
0 Kudos
Message 1 of 3
(2,839 Views)
Wacek,

Use a MultiColumn Listbox, then create a property node of the MultiColumn
Listbox on the wiring diagram. Change the property node to "write" type and
then select property "ItemNames". Wire your 2d string array to this
property node. Should do it.

Hope this helps.

Jim


"Wacek" wrote in message
news:50650000000800000050480000-1019262487000@exchange.ni.com...
> Hi,
> I want use a listbox to make query to a database. The database
> consists of table FRIENDS with such fields like f.e. "name",
> "surname", "address", "age" and so on.
> With query "SELECT DISTINCT Friends.Name FROM Friends" I can get
> unique names that should be included in the listbox. When new name
> will be added to the table, the listbox should be updated as well.
> My probl
em is that result of "SELECT DISTINCT" query is a 2D array
> that is not accepted by listbox.
> Can somebody help me, please?
0 Kudos
Message 2 of 3
(2,839 Views)
Thanks Jim,
I know that 2D array can be use for MultiColumn Listbox but I want to use one-column Listbox.
Just a moment ago I found solution.
0 Kudos
Message 3 of 3
(2,839 Views)