我有以下代码:
Guid id = imageMetaData.ID; Data.LinqTosql.Image dbImage = DBContext.Images.Where(x => x.ID == id).SingleOrDefault(); dbImage.width = imageMetaData.Width; dbImage.height = imageMetaData.Height; DBContext.SubmitChanges();
exec sp_executesql N'UPDATE [dbo].[Images] SET [height] = @p0,[width] = @p1 WHERE 0 = 1',N'@p0 int,@p1 int',@p0=603,@p1=365
为什么我的where语句不包括“where id = ….”???
我究竟做错了什么?
我的应用程序抛出一个ChangeConflictException消息…“行未找到或更改”