Question: I have a simple DataGridView and I am trying to get the value of a cell when a button is clicked. When it is set to a variable it is incorrect but when I quick watch it it is correct. I don't see what is causing this?

```
 Private Sub btnUpdAll_Click(sender As Object, e As EventArgs) Handles btnUpdAll.Click
        For Each r As DataGridViewRow In gvResults.Rows
            Dim x = r.Cells(1).Value
        Next
    End Sub

```

[![Correct value in the cell](https://i.stack.imgur.com/VH7hg.png)](https://i.stack.imgur.com/VH7hg.png)
[![Variable gets this value](https://i.stack.imgur.com/5xqeA.png)](https://i.stack.imgur.com/5xqeA.png)

Answer: 
This solved 

```
sudo apt-get install zlib1g-dev

```

it's ubuntu's tendency to separate dev packages that got someone again. So installing zlib1g won't work by itself. The dev packages must also be installed.
> 
> cannot find -lz
> 
> 
> 

You need to install `zlib`:

```
apt-get install zlib1g

```