Friday, May 3, 2013

When occer these type of error--- operator '=' is not defined for type 'dbnull' and string


When occer these type of error--- operator '=' is not defined for type 'dbnull' and string
                If DataGridView1.Rows(i).Cells("victim_name").Value = p Then

Then to use Convert.ToString
  If Convert.ToString(DataGridView1.Rows(i).Cells("victim_name").Value) = p Then