SQL Datasource Nulling更新参数值?

时间:2014-08-12 12:15:53

标签: c# sql sql-update datasource

我有一个包含update语句的数据源:

UpdateCommand="Update Apps Set AppDate = Convert(Datetime,@AppDate,103), Slot = @Slot,
               Duration = @Duration, TPMId = @TPMId, AppTypeId = @AppTypeId,
               AppStatusId = @AppStatusId, Location = @Location,
               OtherLocation = @OtherLocation, Comments = @Comments
               where AppId = @AppId;
               update Profile Set PrimaryContact = @PrimaryContact,
               ContactTel = @ContactTel, ContactMob = @ContactMob,
               ContactEmail = @ContactEmail where CompanyID = @CompanyID" 

我的更新参数设置如下:

<UpdateParameters>

    <asp:Parameter Name="AppDate" />
    <asp:Parameter Name="Slot" />
    <asp:ControlParameter Name="Duration"  ControlID="HFDuration" />  
    <asp:Parameter Name="TPMId" />
    <asp:Parameter Name="AppTypeId" />
    <asp:Parameter Name="AppStatusId" />
    <asp:Parameter Name="Location" />
    <asp:Parameter Name="OtherLocation" />
    <asp:Parameter Name="Comments" />
    <asp:QueryStringParameter Name="AppId" QueryStringField="AppID" />
    <asp:Parameter Name="PrimaryContact" />
    <asp:Parameter Name="ContactTel" />
    <asp:Parameter Name="ContactMob" />
    <asp:Parameter Name="ContactEmail" />
    <asp:QueryStringParameter Name="CompanyID" QueryStringField="CompanyID" />

</UpdateParameters>

我在表单视图集上设置了双向绑定的所有控件,并且与bind而不是eval坐在一起,例如(&lt;

asp:TextBox ID="LocationTB" runat="server" Text='<%# Bind("Location") %>' 
                                           TextMode="MultiLine"></asp:TextBox>

然而,当涉及到运行更新查询时,实际获得的唯一值是查询字符串和控制参数,其余字段都获得空值。

我之前有多个表单视图,其中包含多个更新查询,所以我知道这可能不是问题所在。

任何人都有任何建议,为什么我的数据源更新会让我的表充满空值?

0 个答案:

没有答案
相关问题