Esempio n. 1
0
        public void LoadData(DataSet ds, string table)
        {
            if(_dbAdaptor != null)
                _dbAdaptor.Dispose();

            _cells = new List<List<string>>();
            _dbAdaptor = new DataBaseAdapter(_path);

            _dbAdaptor.OleDbDataAdapter(table).Fill(ds);

            for (int c = 0; c < ds.Tables[0].Columns.Count-1; c++)
            {
                _cells.Add(new List<string>());
                for (int r = 0; r < ds.Tables[0].Rows.Count-1; r++)
                {
                    _cells[c].Add(ds.Tables[0].Rows[r][c].ToString());
                }
            }
            OnSendEvent("Excell file data has been loaded. File name : "+ Path.GetFileName(_path) + Environment.NewLine);
            OnSendEvent(_cells[0].Count + 1 + " Rows," + (_cells.Count + 1) + " Columns." + Environment.NewLine);
        }
Esempio n. 2
0
        public void LoadData(DataSet ds, string table)
        {
            if (_dbAdaptor != null)
            {
                _dbAdaptor.Dispose();
            }

            _cells     = new List <List <string> >();
            _dbAdaptor = new DataBaseAdapter(_path);

            _dbAdaptor.OleDbDataAdapter(table).Fill(ds);

            for (int c = 0; c < ds.Tables[0].Columns.Count - 1; c++)
            {
                _cells.Add(new List <string>());
                for (int r = 0; r < ds.Tables[0].Rows.Count - 1; r++)
                {
                    _cells[c].Add(ds.Tables[0].Rows[r][c].ToString());
                }
            }
            OnSendEvent("Excell file data has been loaded. File name : " + Path.GetFileName(_path) + Environment.NewLine);
            OnSendEvent(_cells[0].Count + 1 + " Rows," + (_cells.Count + 1) + " Columns." + Environment.NewLine);
        }