Hi Maik,
Did you mean something like this? Because earlier I used the fixed string, "0030002C0030002C0053004100500...."
as the connectionstring for both cases.
public void set_application() { SAPbouiCOM.SboGuiApi SboGuiApi = null; string sConnectionString = null; SboGuiApi = new SAPbouiCOM.SboGuiApi(); // by following the steps specified above, the following // statment should be suficient for either development or run mode if ((System.Environment.GetCommandLineArgs().Length == 0)) { sConnectionString = System.Convert.ToString(Environment.GetCommandLineArgs().GetValue(0)); } else { sConnectionString=System.Environment.GetCommandLineArgs().GetValue(1).ToString(); } try { // If there's no active application the connection will fail SboGuiApi.Connect(sConnectionString); } catch { // Connection failed System.Windows.Forms.MessageBox.Show("No SAP Business One Application was found"); System.Environment.Exit(0); } // get an initialized application object SBO_Application = SboGuiApi.GetApplication(-1); }