Hi,
I feel the checkedlistbox trought this code:
Dim ds As New DataSet
Dim da As New SqlClient.SqlDataAdapter
Dim cnnSQLString As String = "server=mysqlserver; database=mysql; uid=aaaa; pwd = pwdddd;"
Dim SQLString As String = "SELECT pr_oz, pr_opis FROM prSredstvo"
Dim conn As SqlConnection = New SqlConnection(cnnSQLString)
da.SelectCommand = New SqlCommand
da.SelectCommand.Connection = conn
conn.Open()
da.SelectCommand.CommandText = SQLString
'clbProfitniCentri is CheckedListBox
Try
da.Fill(ds, "oe")
clbProfitniCentri.DataSource = ds.Tables(0)
clbProfitniCentri.DisplayMember = ds.Tables("oe").Columns("pr_opis").ToString
clbProfitniCentri.ValueMember = ds.Tables("oe").Columns("pr_oz").ToString
Catch ex As Exception
MsgBox(ex.Message)
End Try
I would like to read a ValueMember of all checked items in my CheckedListBox.
tnx...
brg.,
PeroPero
I feel the checkedlistbox trought this code:
Dim ds As New DataSet
Dim da As New SqlClient.SqlDataAdapter
Dim cnnSQLString As String = "server=mysqlserver; database=mysql; uid=aaaa; pwd = pwdddd;"
Dim SQLString As String = "SELECT pr_oz, pr_opis FROM prSredstvo"
Dim conn As SqlConnection = New SqlConnection(cnnSQLString)
da.SelectCommand = New SqlCommand
da.SelectCommand.Connection = conn
conn.Open()
da.SelectCommand.CommandText = SQLString
'clbProfitniCentri is CheckedListBox
Try
da.Fill(ds, "oe")
clbProfitniCentri.DataSource = ds.Tables(0)
clbProfitniCentri.DisplayMember = ds.Tables("oe").Columns("pr_opis").ToString
clbProfitniCentri.ValueMember = ds.Tables("oe").Columns("pr_oz").ToString
Catch ex As Exception
MsgBox(ex.Message)
End Try
I would like to read a ValueMember of all checked items in my CheckedListBox.
tnx...
brg.,
PeroPero