我正在尝试在使用 aspnet_regsql.exe 安装的 asp 表中添加额外的列。
我在 aspnet_profile 表中添加了额外的列作为 CauseID,并通过添加其他参数作为 @causesID 在 aspnet_Profile_SetProperties 中进行了更改。
我看到有一个名为 ProfileParameter 的类,我确实使用了它,我的代码如下,
ProfileParameter objParameter = new ProfileParameter();
objParameter.ConvertEmptyStringToNull = true;
objParameter.DbType = DbType.Int32;
objParameter.Direction = ParameterDirection.Input;
objParameter.Name = "@CausesID";
objParameter.PropertyName = "CausesId";
在这里,我确实添加了要传递给 aspnet_Profile_SetProperties 的额外参数。但我不确定这是否正确。
在存储过程中,我对已安装的存储过程进行了一些更改,如下所示,
@causesID int => for declaration of parameter
这里我添加了要添加到aspnet_profile的额外参数,
UPDATE dbo.aspnet_Profile
SET PropertyNames=@PropertyNames, PropertyValuesString = @PropertyValuesString,
PropertyValuesBinary = @PropertyValuesBinary, LastUpdatedDate=@CurrentTimeUtc,CausesID=@CausesID WHERE UserId = @UserId
INSERT INTO dbo.aspnet_Profile(UserId, PropertyNames, PropertyValuesString, PropertyValuesBinary, LastUpdatedDate,CausesID)
VALUES (@UserId, @PropertyNames, @PropertyValuesString, @PropertyValuesBinary, @CurrentTimeUtc,@CausesID)
在 aspnet_profile 表中,我添加了一个列作为 CauseID。
但这对我不起作用。
请就这个问题给我建议。
提前致谢..:)