Hi guys,

(Using .net cf 2.0)

I have the following sql statement:
VB Code:
  1. With sqlCmd
  2.             .CommandText = "SELECT count(*) FROM photos WHERE photoLocation LIKE '" & H42_PHOTO_DIRECTORY & "%'"
  3.             '.Parameters.Add(New SqlCeParameter("@photoLocation", H42_PHOTO_DIRECTORY & "%"))
  4.             Dim assigned As Integer = .ExecuteScalar
  5.             MsgBox(assigned)
  6.             '.Parameters.Clear()
  7.         End With

But it always returns 0 when i know that it shouldn't
(by the way H42_PHOTO_LOCATION is a folder on my Pocket PC.) I need it if possible to be done using parameters. Can anybody tell me why this isn't working?

Thanks in advance for any help