我有这个奇怪的问题,BLToolkit在我们的数据库中保存NULL而不是0。
如果您查看图像,这是我保存的值。 (gIdx代表GroupIndex)
以下是数据库中的结果。如果你查看GroupIndex列,我只有1和2.(这也适用于SortIndex列)
这是我的存储过程。该列只是一个NULL,INT
USE [ASTUSADMINISTRATION]
GO
/****** Object: StoredProcedure [dbo].[stpr_GridColumnLayout_Update] Script Date: 2015-06-22 08:08:28 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[stpr_GridColumnLayout_Update]
@ID AS [usrID],
@Width AS int,
@Index AS int,
@IsCellMerged AS [usrBoolean],
@GroupIndex AS int,
@SortIndex AS int,
@SortDirectionType AS int,
@SummaryItemType AS int,
@UpdatedDate AS datetime OUTPUT,
@UpdatedUser AS [usrUsername]
AS
BEGIN
SET NOCOUNT ON
SET @UpdatedDate = GETDATE()
-- Vérifier si c'est un groupe système
UPDATE [dbo].[GridColumnLayout] SET
[Width] = @Width,
[Index] = @Index,
[IsCellMerged] = @IsCellMerged,
[GroupIndex] = @GroupIndex,
[SortIndex] = @SortIndex,
[SortDirectionType] = @SortDirectionType,
[SummaryItemType] = @SummaryItemType,
[UpdatedDate] = @UpdatedDate,
[UpdatedUser] = @UpdatedUser
WHERE [GridColumnLayoutID] = @ID
END
字符串也会发生类似的问题。只保存1个字符。 (more detail here)
答案 0 :(得分:0)
这实际上是使用存储过程插入数据库时使用ExecuteForEach
方法时BLToolkit的错误。