Dim db As New SQLDataContext
Try
Dim deleteBoatPics = (From boat In db.Photos
Where boat.boatid = id)
db.Photos.DeleteOnSubmit(deleteBoatPics)
db.SubmitChanges()
Catch ex As Exception
End Try
我收到一条错误消息:无法将“System.Data.Linq.DataQuery`1[WhiteWaterPhotos.Photo]”类型的对象转换为“WhiteWaterPhotos.Photo”。
我有两个单独的 db.SubmitChanges() 因为当按下按钮时,我让它从 1 个表中删除记录,然后是下一个。
我迷路了,有人可以帮我吗?