Beispiel #1
0
        override public DataTable GetPreviewTable(int previewRowsCount = 100)
        {
            DataTable result = new DataTable();

            foreach (var f in _shpWork.GetShapeFields())
            {
                result.Columns.Add(f.Key, f.Value);
            }
            _shpWork.StartRead();
            for (int i = 0; i < previewRowsCount && _shpWork.Read(); i++)
            {
                List <object> colData = new List <object>();
                for (int j = 0; j < result.Columns.Count; j++)
                {
                    colData.Add(_shpWork[j]);
                }
                result.Rows.Add(colData.ToArray());
            }
            _shpWork.EndRead();
            return(result);
        }