コード例 #1
0
        /// <summary>
        /// 获取数据表集合
        /// </summary>
        /// <returns></returns>
        public DataSet XmlReadDataSet()
        {
            DataSet dataSet = new DataSet();

            foreach (var config in configs)
            {
                current = config;
                try
                {
                    dataSet.Tables.Add(XmlReadDataTable());
                }
                catch (Exception ex)
                {
                    ExecuteLog.Add($"[ReadDataTable]:[{ex.Message}]");
                }
            }
            return(dataSet);
        }
コード例 #2
0
        /// <summary>
        /// Send a chunk of code (it can be more than one command, separated by delimiters and/or
        /// newlines) to the kernel.  Because of the asynchronous nature of execution, this merely
        /// sends off the code to be executed - there is no immediate response.
        /// </summary>
        /// <param name="code"></param>
        public void Execute(string code)
        {
            var message = ClientSession.CreateMessage(MessageType.ExecuteRequest);

            message.Content               = new ExpandoObject();
            message.Content.code          = code;
            message.Content.silent        = false;
            message.Content.store_history = true;
            message.Content.allow_stdin   = false;
            message.Content.stop_on_error = true;
            _ShellChannel.Send(message);

            // We start tracking an execute request once it is sent on the shell channel.
            lock (ExecuteLogSync)
            {
                ExecuteLog.Add(message.Header.Id, new ExecutionEntry()
                {
                    Request = message
                });
            }
        }