我通过在包含输入字段和网格的同一页面中输入一些字段来更新数据库中的表。但是连接到该表的网格在提交值后不会刷新。我必须在新选项卡中打开该页面才能查看更改。我也希望这些输入字段在提交后为空。
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:con %>"
ProviderName="<%$ ConnectionStrings:con.ProviderName %>"
SelectCommand="SELECT * FROM [View_Intakesheet]"
InsertCommand="INSERT INTO [View_Intakesheet] [date_withdrawn], [date_delivered], [qc_by], [qc_date], [additional_notes], [Case_Status_Text], [Case_Type_Text]) VALUES (@date_withdrawn, @date_delivered, @qc_by, @qc_date, @additional_notes, @Case_Status_Text, @Case_Type_Text)"
UpdateCommand="UPDATE intakesheet SET date_withdrawn= @date_withdrawn, date_delivered= @date_delivered, qc_by = @qc_by, qc_date=@qc_date, additional_notes = @additional_notes WHERE (case_number = @case_number)">
<InsertParameters>
<asp:Parameter Name="date_withdrawn" />
<asp:Parameter Name="date_delivered" />
<asp:Parameter Name="qc_by" />
<asp:Parameter Name="qc_date" />
<asp:Parameter Name="additional_notes" />
<asp:Parameter Name="Case_Status_Text" />
</InsertParameters>
<SelectParameters>
<asp:SessionParameter Name="assigned_to" SessionField="Name" Type="String" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="case_status" />
<asp:Parameter Name="date_withdrawn" />
<asp:Parameter Name="date_delivered" />
<asp:Parameter Name="qc_by" />
<asp:Parameter Name="qc_date" />
<asp:Parameter Name="additional_notes" />
<asp:Parameter Name="case_number" />
<asp:Parameter Name="case_type" />
</UpdateParameters>
</asp:SqlDataSource>