必须声明标量变量“@ ...”

时间:2012-09-10 18:42:30

标签: c# asp.net sql

我正在开发一个网站,当我选择GridView中的一行时,我正在显示一个带有DetailsView的GridView。在DetailsView中,我有一个编辑按钮,可以让用户编辑一些信息。错误消息是:

必须声明标量变量“@original_FirstName”。

以下是代码:

<asp:SqlDataSource ID="SqlDataSource1" runat="server"  
    ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" OldValuesParameterFormatString="original_{0}"  
    SelectCommand="SELECT * FROM aspnet_Membership ORDER BY [Email], [LastName], [Company]" 
    UpdateCommand="UPDATE aspnet_Membership SET [FirstName] = @FirstName, [LastName] = @LastName, [Company] = @Company, [PartsList] = @PartsList, 
                  [UserName] = @UserName, [Question] = @Question, [Answer] = @Answer, [Role] = @Role, [Comment] =@Comment
                  WHERE [FirstName] = @original_FirstName AND [LastName] = @original_LastName AND [Company] = @original_Company AND
                  [PartsList] = @original_PartsList AND [UserName] = @original_UserName AND [Question] = @original_Question AND
                  [Answer] = @original_Answer AND [Role] = @original_Role AND [Comment] =@original_Comment"> 
        <UpdateParameters> 
            <asp:Parameter Name="FirstName" Type="String" /> 
            <asp:Parameter Name="LastName" Type="String" /> 
            <asp:Parameter Name="Company" Type="String" /> 
            <asp:Parameter Name="PartsList" Type="String" /> 
            <asp:Parameter Name="UserName" Type="String" /> 
            <asp:Parameter Name="Password" Type="String" /> 
            <asp:Parameter Name="Email" Type="String" /> 
            <asp:Parameter Name="Question" Type="String" /> 
            <asp:Parameter Name="Answer" Type="String" /> 
            <asp:Parameter Name="Role" Type="String" /> 
            <asp:Parameter Name="Comment" Type="String" />                    
        </UpdateParameters> 
</asp:SqlDataSource> 

0 个答案:

没有答案