Jump to content
Sign in to follow this  

Single Column SQL in Listview

Recommended Posts


Hi guys,

Iam struggel with some madness in my head... i cant figgur it out with my lack of expertise of programming.

i have a SQL query

query1 = _SQLExecute(-1,"SELECT DISTINCT column1 AS column1 FROM Cars ORDER BY Column1")

i put it in a string

$String1 = _SqlGetDataAsString($query1)

But how can i put this in a listview?

i tried this but doesn't format it right

$listview = GUICtrlCreateList ("", 40, 100,150,200)
GUICtrlSetData($listview, $String1 )


Share this post

Link to post
Share on other sites

From the Help... :P

$listview = GUICtrlCreateListView("col1  |col2|col3  ", 10, 10, 200, 150)
    $item1 = GUICtrlCreateListViewItem("item2|col22|col23", $listview)
    $item2 = GUICtrlCreateListViewItem("item1|col12|col13", $listview)
    $item3 = GUICtrlCreateListViewItem("item3|col32|col33", $listview)
; Change Item
    GUICtrlSetData($item2, "ITEM1")
    GUICtrlSetData($item3, "||COL33")

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this