Search code examples
c#winformssapb1

SAP B1 SDK - How can I execute a query and fill the result in a combo box


How can I execute a query using RecordSet from SAP B1 SDK and fill the result in comboBox in C# windows form application??
for example I want to do query in order to gather saved languages in OLNG table


Solution

  • the Below should be a good starting point.

     oRS.DoQuery("Select Name From OLNG")
     for (int i=0 ; i<oRS.RecordCount ; i++)
     {  
      myComboBox.validValues.Add(oRS.Fields.Item("Name").Value.ToString()), 
      oRS.Fields.Item("Name").Value.ToString());    
      record.MoveNext();
     }