You can make query on assign dataset which is assign with datagridview. for example.
dim ds as new dataset
Dim da as new oledb.OledbDataAdapter("Select * from table1",conn)
da.Fill(ds)
DataGridView1.DataSource = ds.Table(0)
'Now if you want to check that record is all ready exists of not.
dim dr as datarow()
dr = ds.Table(0).select("SearchFieldName = " & 'SearchValue)
if dr.Length >0 then
Messagebox.show("Duplicate Record")
end if