title: how to check if the cell value is nothing or not in vb.net?
body: <p><br>
  i am using grid view in vb.net.<br>
  here is code...</p>
  
  <pre><code>If Not DataGridView1.SelectedRows.Count = 0 Then
                  i = DataGridView1.SelectedRows(0).Index
                  If DataGridView1.Rows(i).Cells(0).Value &lt;&gt; Nothing Then
                      namebox.Text = Trim(DataGridView1.Rows(i).Cells(0).Value)
                      salarybox.Text = DataGridView1.Rows(i).Cells(1).Value
                  End If
  End If
  </code></pre>
  
  <p>now if the cell has nothing in it then it will show the exception....<br>
  like this...</p>
  
  <pre><code>Operator '&lt;&gt;' is not defined for type 'DBNull' and 'Nothing'.
  </code></pre>
  
  <p>this is code will be called when selected cell will be changed.<br>
  i trying to get the values of the selected cell and put that in in one text box.<br></p>