is it possible to detect whether a file has been selected during the update process and only update the image if one has been selected, in other words be able to update the other fields without always having to re-upload the image?
I changed UpdateCommandType="StoredProcedure" and UpdateCommand to the sp name, then in the stored procedure checked for null on the data param and varied the update accordingly.
OnUpdated="DBCompleted" OnInserted="DBCompleted" OnDeleted="DBCompleted" SelectCommand="SELECT [advertId], [title], [alt], [href], [refCode], [imgData], s.[sizeId], s.[size], co.[consumerId], ISNULL(co.[name], 'All Consumers') AS consumerName, ca.[categoryId], ISNULL(ca.[name], 'All Categories') AS [categoryName], [active] FROM [Adverts] a INNER JOIN [Sizes] s ON a.[sizeId] = s.[sizeId] LEFT JOIN [Consumers] co ON a.[consumerId] = co.[consumerId] LEFT JOIN [Categories] ca ON a.[categoryId] = ca.[categoryId] ORDER BY [title]"
DeleteCommand="DELETE FROM [Adverts] WHERE [advertId] = @advertId" InsertCommand="INSERT INTO [Adverts] ([title], [alt], [href], [refCode], [imgData], [sizeId], [consumerId], [categoryId], [active]) VALUES (@title, @alt, @href, @refCode, @imgData, @sizeId, @consumerId, @categoryId, @active)"
This does not enable you to remove an image already uploaded, but in this case that is fine. I guess I could add a custom GridButtonColumn to fire a separate stored proc to remove the image if that is ever required.