我有一個GridView,用戶可以編輯UNIQUEID,這應該然後更新其中列REF是唯一標識符ASP GridView控件更新不工作
但是,這是行不通的,沒有錯誤,頁面只是刷新時,點擊更新並沒有什麼變化:
任何幫助表示讚賞感謝
<asp:GridView ID="GridView3" runat="server"
AutoGenerateColumns="False" DataSourceID="SqlDataSource2"
ShowHeaderWhenEmpty="True"
showfooterwhenempty="true"
ShowFooter="True" AllowPaging="True" PageSize="20"
CssClass="pagination myTable"
BorderColor="#D9D9D9"
borderstyle="Solid"
BorderWidth="1px"
EnableModelValidation="True" GridLines="Both" AutoGenerateEditButton="True">
<HeaderStyle cssClass="myheader" BackColor="#e6EEEE" />
<rowstyle CssClass="myRow" HorizontalAlign="left" BorderColor="#D9D9D9" BorderStyle="Solid" BorderWidth="1px" />
<alternatingrowstyle CssClass="myAltRow" backcolor="#F0F0F6" HorizontalAlign="left" BorderColor="#D9D9D9" BorderStyle="Solid" BorderWidth="1px" />
<Columns>
<asp:BoundField DataField="uniqueID" HeaderText="uniqueID"
SortExpression="uniqueID" />
<asp:BoundField DataField="REF" HeaderText="REF" SortExpression="REF" ReadOnly="true" />
</Columns>
<emptydatarowstyle backcolor="LightBlue" forecolor="Red"/>
<EmptyDataTemplate>
Please enter a unique ID in the search box above.
</EmptyDataTemplate>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:DGRecon_DevConnectionString %>"
SelectCommand=" SELECT
*
FROM postfinance
where uniqueID = @uniqueID"
Updatecommand="UPDATE postfinance SET uniqueID = @uniqueID WHERE REF = @REF">
<UpdateParameters>
<asp:Parameter Name="uniqueID" Type="String" />
<asp:Parameter Name="ref" Type="String" />
</UpdateParameters>
<SelectParameters>
<asp:ControlParameter Name="uniqueID" ControlID="uniqueID" />
</SelectParameters>
</asp:SqlDataSource>
</div>