表适配器更新失败

时间:2013-06-28 04:41:40

标签: c# .net sql-update tableadapter

我正在使用表适配器方法来更新数据库上的数据,我正在更新两列,但是一列无法正确更新其他列更新...这是什么原因?我该如何解决这个问题?请帮助..

这是SP

USE [PNSBL7Data]
GO
/****** Object:  StoredProcedure [dbo].[EmpOTApr_Update]    Script Date: 6/28/2013 9:25:54 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[EmpOTApr_Update] 
-- Add the parameters for the stored procedure here

@AtnDetKy bigint,
@AprOT bigint,
@isAprOTMin bit

AS
--declare  @AprOt bigint
--declare @AtnDetExtKy bigint

--set @AtnDetExtKy = 112
--set @AprOt = 25
--SET NOCOUNT OFF;

UPDATE    AtnDetExt SET isAprOTMin=@isAprOTMin ,AprOTMins = @AprOT

WHERE     (AtnDetKy = @AtnDetKy)

SELECT     EmpMas.EmpNo, EmpMas.EmpNm, AtnDet.AtnDt, AtnDet.EmpKy, AtnDet.InDtm, AtnDet.OutDtm, AtnDetExt.OT1Mint AS NorOT, AtnDetExt.OT2Mint AS DouOT, 
                  AtnDetExt.OT3Mint AS TriOT, AtnDetExt.AprOTMins, AtnDet.AtnDetKy
FROM         AtnDet INNER JOIN
                  AtnDetExt ON AtnDet.AtnDetKy = AtnDetExt.AtnDetKy INNER JOIN
                  EmpMas ON AtnDet.EmpKy = EmpMas.EmpKy
WHERE     (AtnDet.AtnDetKy = @AtnDetKy) AND (AtnDetExt.AprOTMins = @AprOT)

这是表适配器更新

image

1 个答案:

答案 0 :(得分:0)

检查DB和此适配器中的数据类型。它应该正确映射。还有一件事是检查源版本。