on 12-09-2011 4:07 AM
I want to bind my ComboBox from query. How can I do that? Please help.
When the form is load, the ComboBox will fill from my database. Like BPName.
Thanks
Hi
Try this
Dim rsResult As SAPbobsCOM.Recordset = Nothing
Dim sValue, sDescription As String
rsResult = B1Connections.diCompany.GetBusinessObject(BoObjectTypes.BoRecordset)
While _comboBox.ValidValues.Count > 0
_comboBox.ValidValues.Remove(0, SAPbouiCOM.BoSearchKey.psk_Index)
End While
rsResult.DoQuery("Select Code,Name from OUBR")
rsResult.MoveFirst()
While Not rsResult.EoF
sValue = rsResult.Fields.Item(0).Value.ToString()
sDescription = rsResult.Fields.Item(1).Value.ToString()
_comboBox.ValidValues.Add(sValue, sDescription)
rsResult.MoveNext()
End While
Regards
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.