steve_rm
Dec 6th, 2006, 09:27 AM
Hello,
I am populating at combo box from a dataset. But when I run the program I find I get system.data.datarowview being displayed in the combo box. What should be displayed is the values in the table. i.e. R4484, G5474.
I am using pocket PC 5.0. I have tried this code in a simple window form, and it works fine, but not in a pocket Pc application. That is why i posted here. Thought maybe there was something wrong with this type of control being used in pocket pc application.
ds = ws.loadSupportContracts(clientID)
If (ds.Tables(0).Rows.Count > 0) Then
Me.cboSupportContracts.DisplayMember = "supportContractID"
Me.cboSupportContracts.ValueMember = "supportContractID"
Me.cboSupportContracts.DataSource = ds.Tables("contracts").DefaultView
End If
I did try and solve this problem by doing the follow. But had an error "value does not fall within the expected range"
ds = ws.loadSupportContracts(clientID)
Me.cboSupportContracts.DataSource = ds.Tables("contracts").DefaultView
Me.cboSupportContracts.DisplayMember = "supportContractID"
Me.cboSupportContracts.ValueMember = "supportContractID"
I have also tried using a binding source but still the combo box kept on displaying system.data.datarowview.
ds = ws.loadContacts(clientID)
bs.DataSource = ds
bs.DataMember = "contracts"
If (ds.Tables(0).Rows.Count > 0) Then
Me.cboContact.Items.Clear()
Me.cboSupportContracts.DisplayMember = "supportContractID"
Me.cboSupportContracts.ValueMember = "supportContractID"
Me.cboContact.DataSource = bs
End If
If anyone has any ideas about this please let me know.
Many thanks in advance,
Steve
I am populating at combo box from a dataset. But when I run the program I find I get system.data.datarowview being displayed in the combo box. What should be displayed is the values in the table. i.e. R4484, G5474.
I am using pocket PC 5.0. I have tried this code in a simple window form, and it works fine, but not in a pocket Pc application. That is why i posted here. Thought maybe there was something wrong with this type of control being used in pocket pc application.
ds = ws.loadSupportContracts(clientID)
If (ds.Tables(0).Rows.Count > 0) Then
Me.cboSupportContracts.DisplayMember = "supportContractID"
Me.cboSupportContracts.ValueMember = "supportContractID"
Me.cboSupportContracts.DataSource = ds.Tables("contracts").DefaultView
End If
I did try and solve this problem by doing the follow. But had an error "value does not fall within the expected range"
ds = ws.loadSupportContracts(clientID)
Me.cboSupportContracts.DataSource = ds.Tables("contracts").DefaultView
Me.cboSupportContracts.DisplayMember = "supportContractID"
Me.cboSupportContracts.ValueMember = "supportContractID"
I have also tried using a binding source but still the combo box kept on displaying system.data.datarowview.
ds = ws.loadContacts(clientID)
bs.DataSource = ds
bs.DataMember = "contracts"
If (ds.Tables(0).Rows.Count > 0) Then
Me.cboContact.Items.Clear()
Me.cboSupportContracts.DisplayMember = "supportContractID"
Me.cboSupportContracts.ValueMember = "supportContractID"
Me.cboContact.DataSource = bs
End If
If anyone has any ideas about this please let me know.
Many thanks in advance,
Steve