Hi guys,

(Using .net cf 2.0)
I have the following insert statement:

VB Code:
  1. With sqlCmd
  2.             .CommandText = "INSERT INTO photos(visitID, photoType, photoLocation, havePhoto)VALUES(@visitID, @photoType, @photoLocation, @havePhoto)"
  3.             .Parameters.Add(New SqlCeParameter("@visitID", GetCurrentVisit()))
  4.             .Parameters.Add(New SqlCeParameter("@photoLocation", photoLocation))
  5.             .Parameters.Add(New SqlCeParameter("@photoType", photoType))
  6.             .Parameters.Add(New SqlCeParameter("@havePhoto", "Y"))
  7.             .ExecuteNonQuery()
  8.             .Parameters.Clear()
  9.         End With

But i only want it to do the insert if the value in photoLocation doesn't already exist?
How can i go about doing this?

Thanks in advance for any help