/// <summary>
        /// 输出[Table]所有内容
        /// </summary>
        private void ShowTotalTable()
        {
            dataGridView1.DataSource = null;
            var queryResult = database.ExecuteQuery("select * from " + TableName);

            dataGridView1.DataSource = queryResult;
            this.dataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.DisplayedCells);
            this.dataGridView1.RowHeadersWidth = GetRowHeaderWidth(queryResult.Rows.Count);
        }
 private void QueryAndCalculate()
 {
     try
     {
         sqlite.ExecuteUpdate(DeleteTempVarsSQL());
     }
     catch (Exception)
     {
     }
     sqlite.ExecuteUpdate(CreateSqlFunctionSQL());
     resultTable = sqlite.ExecuteQuery(CountSumDateTimeOfEachMonthSQL());
 }
Пример #3
0
        private void FillTextBox()
        {
            DataTable analyseData = database.ExecuteQuery(AverageDurationSQL());

            foreach (DataRow row in analyseData.Rows)
            {
                textBox1.Text = "数据库平均登录时间为: ";
                try
                {
                    textBox1.Text += row[0].ToString();
                    if (float.Parse(row[0].ToString()) > 5)
                    {
                        CreateTipButton(float.Parse(row[0].ToString()));
                    }
                }
                catch (FormatException)
                {
                    textBox1.Text += "0";
                }
                textBox1.Text += "s";
            }
        }