U
Uli Netzer
between Dim strXYZ() as String
and Dim strXYZ as String()
It doesn't seem to make a difference in the way I use the variable.
Another problem I have.
I load three variables with 3 values each which then get loaded into a
datatable with 3 columns. This datatable is then the datasource from a
combobox. This works fine until I choose another index of the combobox and
want to switch back to the 0 index. It won't let me. It seems to stick to
the second index (1)
Dim strNames() As String = {"domain 1", "domain 2", "domain 3"}
Dim strString() As String = {LDAP://domain 1, LDAP://domain 2, LDAP://domain
3}
Dim strDomain() As String = {"domain 1.com", "domain 2.com", "domain 3.com"}
Dim i As Int16
Dim dr As Data.DataRow
Try
dt = dsDomains.Tables("dtDomainNames")
For i = 0 To strNames.Length - 1
dr = dt.NewRow()
dr("colName") = strNames(i)
dr("colString") = strString(i)
dr("colDomain") = strDomain(i)
dt.Rows.Add(dr)
Next
....
If I remove the datasource and just add the items (strNames) and call the
following on cboDomains.SelectionChangeCommitted
strLDAPDomain = dtDomainNames.Rows.Item(CType(sender,
ComboBox).SelectedIndex).Item("colString")
it works like a charm.
and Dim strXYZ as String()
It doesn't seem to make a difference in the way I use the variable.
Another problem I have.
I load three variables with 3 values each which then get loaded into a
datatable with 3 columns. This datatable is then the datasource from a
combobox. This works fine until I choose another index of the combobox and
want to switch back to the 0 index. It won't let me. It seems to stick to
the second index (1)
Dim strNames() As String = {"domain 1", "domain 2", "domain 3"}
Dim strString() As String = {LDAP://domain 1, LDAP://domain 2, LDAP://domain
3}
Dim strDomain() As String = {"domain 1.com", "domain 2.com", "domain 3.com"}
Dim i As Int16
Dim dr As Data.DataRow
Try
dt = dsDomains.Tables("dtDomainNames")
For i = 0 To strNames.Length - 1
dr = dt.NewRow()
dr("colName") = strNames(i)
dr("colString") = strString(i)
dr("colDomain") = strDomain(i)
dt.Rows.Add(dr)
Next
....
If I remove the datasource and just add the items (strNames) and call the
following on cboDomains.SelectionChangeCommitted
strLDAPDomain = dtDomainNames.Rows.Item(CType(sender,
ComboBox).SelectedIndex).Item("colString")
it works like a charm.