如何在aspnet_profile中添加额外的列并在aspnet_Profile_SetProperties中进行修改?

时间:2013-08-08 09:39:26

标签: asp.net stored-procedures

我正在尝试使用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。

但它对我不起作用。

请在这个问题上告诉我。

提前致谢.. :))

1 个答案:

答案 0 :(得分:0)

我建议你不要弄乱会员实施的内部情况,而是要使用个人资料的可能性。

相关问题