示例#1
0
        public List <DatasetInfo> GetDatasets()
        {
            List <string>      datasetNames = GetDatasetNames();
            List <DatasetInfo> result       = new List <DatasetInfo>();

            OpenDB();
            foreach (string dsName in datasetNames)
            {
                DatasetInfo dsInfo = new DatasetInfo();
                dsInfo.Name     = dsName;
                dsInfo.RowCount = getCount("select v from " + dsName + "_profile where k = 'AllNodeCount'");
                dsInfo.ColCount = 7 + getCount("select count(*) from " + dsName + "_profile where k = 'TableOptCol'");

                #region 查询数据集创建日期
                cmd.CommandText = "select CREATE_TIME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='tree' and TABLE_NAME='" + dsName + "_profile'";
                MySqlDataReader reader = cmd.ExecuteReader();
                if (reader.Read())
                {
                    dsInfo.CreateData = reader.GetDateTime(0);
                }
                reader.Close();
                #endregion

                result.Add(dsInfo);
            }
            CloseDB();
            return(result);
        }
示例#2
0
        private void SetDatasetInfo(DatasetInfo dsInfo)
        {
            dsName.Text      = dsInfo.Name;
            dsCol.Text       = dsInfo.ColCount.ToString();
            dsCrateDate.Text = dsInfo.CreateData.ToString();

            int row = dsInfo.RowCount;

            if (row < 10000)
            {
                dsRow.Text = row.ToString();
            }
            else
            {
                int big   = row / 10000;
                int small = row % 10000;
                dsRow.Text = string.Format("{0}万{1}", big, small);
            }

            dsSize.Value = ((double)row * dsInfo.ColCount * 100) / 100000000;
        }
示例#3
0
        public List <DatasetInfo> GetDatasets()
        {
            List <string>      datasetNames = GetDatasetNames();
            List <DatasetInfo> result       = new List <DatasetInfo>();

            foreach (string dsName in datasetNames)
            {
                if (ConnectDB(dsName))
                {
                    try
                    {
                        OpenDB();
                        DatasetInfo dsInfo = new DatasetInfo();
                        dsInfo.Name     = dsName;
                        dsInfo.RowCount = getCount("select v from tree_profile where k = 'AllNodeCount'");
                        dsInfo.ColCount = 7 + getCount("select count(*) from tree_profile where k = 'TableOptCol'");

                        #region 获取创建时间
                        FileInfo file = new FileInfo(MemData.MemDataSqlite + "/" + dsName + ".db");
                        if (file != null)
                        {
                            dsInfo.CreateData = file.CreationTime;
                        }
                        #endregion

                        result.Add(dsInfo);
                        CloseDB();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(dsName + ".db密码不正确而无法打开!\n" + ex.Message);
                    }
                }
            }
            return(result);
        }
示例#4
0
 public DatasetBtn(DatasetInfo dsInfo)
 {
     InitializeComponent();
     SetDatasetInfo(dsInfo);
 }
示例#5
0
 public BtnDataset(DatasetInfo db)
 {
     InitializeComponent();
     this.txtName.Text = db.Name;
     this.ToolTip      = db.GetOtherString();
 }