/// <summary> /// Allows the execution of any command from the Database synchronously only. /// </summary> /// <param name="statement">The command you want to execute in the Database.</param> /// <param name="outputFormat">Indicates in what format you want to receive the data resulting from the operation: MV, XML or JSON.</param> /// <param name="customVars">Free text sent to the database allows management of additional behaviours in SUB.LK.MAIN.CONTROL.CUSTOM, which is called when this parameter is set.</param> /// <param name="receiveTimeout">Maximum time in seconds that the client will wait for a response from the server. Default = 0 to wait indefinitely.</param> /// <returns>The results of the operation.</returns> public string Execute(string statement, DATAFORMAT_TYPE outputFormat = DATAFORMAT_TYPE.MV, string customVars = "", int receiveTimeout = 0) { string executeArgs = OperationArguments.GetExecuteArgs(statement, customVars); byte opCode = (byte)OPERATION_CODE.EXECUTE; byte byteInputFormat = (byte)DATAFORMAT_TYPE.MV; byte byteOutputFormat = (byte)outputFormat; string connectionInfo = this._ConnectionInfo.ToString(); string result = Linkar.ExecutePersistentOperation(this._ConnectionInfo, opCode, executeArgs, byteInputFormat, byteOutputFormat, receiveTimeout); return(result); }
/// <summary> /// Allows the execution of any command from the Database synchronously only. /// </summary> /// <param name="credentialOptions">Object with data necessary to access the Linkar Server: Username, Password, EntryPoint, Language, FreeText.</param> /// <param name="statement">The command you want to execute in the Database.</param> /// <param name="outputFormat">Indicates in what format you want to receive the data resulting from the operation: MV, XML or JSON.</param> /// <param name="customVars">Free text sent to the database allows management of additional behaviours in SUB.LK.MAIN.CONTROL.CUSTOM, which is called when this parameter is set.</param> /// <param name="receiveTimeout">Maximum time in seconds that the client will wait for a response from the server. Default = 0 to wait indefinitely.</param> /// <returns>The results of the operation.</returns> public static string Execute(CredentialOptions credentialOptions, string statement, DATAFORMAT_TYPE outputFormat = DATAFORMAT_TYPE.MV, string customVars = "", int receiveTimeout = 0) { string executeArgs = OperationArguments.GetExecuteArgs(statement, customVars); byte opCode = (byte)OPERATION_CODE.EXECUTE; byte byteInputFormat = (byte)DATAFORMAT_TYPE.MV; byte byteOutputFormat = (byte)outputFormat; string result = Linkar.ExecuteDirectOperation(credentialOptions, opCode, executeArgs, byteInputFormat, byteOutputFormat, receiveTimeout); return(result); }