Skip to Content
Nov 23, 2018 at 02:50 AM

SAP Business One SQL where clause


Dear All Experts/Gurus,

I am a newbie in the development of SBO. I would like to ask if what is the proper syntax or practice to be use,

for example i have a textbox or combobox and i will used it's value into my SQL Where clause.

            String ocGroupCodeSelectedItem;
            ocGroupCodeSelectedItem = cGroupCode.SelectedItem.ToString();
            Double oGroupCode;

            SAPbobsCOM.Recordset oRecD = default(SAPbobsCOM.Recordset);
            oRecD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
            String sSql11 = "SELECT GroupCode FROM OCRG WHERE GroupCode = ";


            oGroupCode = oRecD.Fields.Item("GroupCode").Value;
            MessageBox.Show(" " + oGroupCode);

Good Day!