Question: My program loads data from a MySQL database into a `DataGridView`. I want to hide the first column (`id` column), but I get the reentrance cell error.

CODE:

```
void dataGridGlavni_CellFormatting(object sender, System.Windows.Forms.DataGridViewCellFormattingEventArgs e)
    {
        if (this.dataGridGlavni.Columns[e.ColumnIndex].Name == "id")
        {
            this.dataGridGlavni.Columns[e.ColumnIndex].Visible = false; // <<<< error
        }
        if (this.dataGridGlavni.Columns[e.ColumnIndex].Name == "Plate za mesec")
        {
            GlavniForm.ShortFormDateFormat(e);
        }
    }

```

ERROR:

> 
> Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function.
> 
> 
> 

The error also appears when I use the following line:

```
this.dataGridGlavni.Columns[0].Visible = false;

```

However it does NOT appear when I use these lines:

```
this.dataGridGlavni.Columns[1].Visible = false;

```

OR

```
this.dataGridGlavni.Columns["Plate za mesec"].Visible = false;

```

I googled a lot and haven't been able to find the source of the error. What is happening why won't it let me hide the first column ?

Thank you

Answer: 
`EXEC sp_spaceused @oneresultset = 1` 
show in 1 row all of the result

if you execute just 'EXEC sp\_spaceused' you will see two rows
Work in SQL Server Management Studio v17.9
If you would like to get size of real data, you'll need to filter 'ONLINE' data files only. Otherwise you can get a size that significately different from the size you see in GUI. Some ghost | old garbage records can be in the sys.master\_files, for example 'DEFUNCT' data files.

```
    with fs
    as
    (
        select database_id, type, size * 8.0 / 1024 size, physical_name
        from sys.master_files
        where state_desc = 'ONLINE' -- ONLINE,RESTORING,RECOVERING,RECOVERY_PENDING,SUSPECT,,OFFLINE, DEFUNCT
    )
    select 
        name,
        (select sum(size) from fs where type = 0 and fs.database_id = db.database_id) DataFileSizeMB,
        (select sum(size) from fs where type = 1 and fs.database_id = db.database_id) LogFileSizeMB,
        (select sum(size) from fs where fs.database_id = db.database_id) TotalFileSizeMB
    from sys.databases db
    --order by database_id
    order by TotalFileSizeMB desc

```