SqlDATASource と DetailsView の完全なソース コードは次のとおりです。
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:HADIConnectionString %>"
DeleteCommand="DELETE FROM "INDENT_FILE_NO" WHERE "FILE_NO_ID" = :original_FILE_NO_ID AND (("INDENT_ID" = :original_INDENT_ID) OR ("INDENT_ID" IS NULL AND :original_INDENT_ID IS NULL)) AND (("FILE_NO" = :original_FILE_NO) OR ("FILE_NO" IS NULL AND :original_FILE_NO IS NULL)) AND (("FILE_DESCRIPTION" = :original_FILE_DESCRIPTION) OR ("FILE_DESCRIPTION" IS NULL AND :original_FILE_DESCRIPTION IS NULL)) AND (("INDENTER" = :original_INDENTER) OR ("INDENTER" IS NULL AND :original_INDENTER IS NULL))" InsertCommand="INSERT INTO "INDENT_FILE_NO" ("FILE_NO_ID", "INDENT_ID", "FILE_NO", "FILE_DESCRIPTION", "INDENTER") VALUES (:FILE_NO_ID, :INDENT_ID, :FILE_NO, :FILE_DESCRIPTION, :INDENTER)" OldValuesParameterFormatString="original_{0}" ProviderName="<%$ ConnectionStrings:HADIConnectionString.ProviderName %>"
SelectCommand="SELECT * FROM "INDENT_FILE_NO" WHERE ("INDENT_ID" = :INDENT_ID)"
UpdateCommand="UPDATE "INDENT_FILE_NO" SET "INDENT_ID" = :INDENT_ID, "FILE_NO" = :FILE_NO, "FILE_DESCRIPTION" = :FILE_DESCRIPTION, "INDENTER" = :INDENTER WHERE "FILE_NO_ID" = :original_FILE_NO_ID AND (("INDENT_ID" = :original_INDENT_ID) OR ("INDENT_ID" IS NULL AND :original_INDENT_ID IS NULL)) AND (("FILE_NO" = :original_FILE_NO) OR ("FILE_NO" IS NULL AND :original_FILE_NO IS NULL)) AND (("FILE_DESCRIPTION" = :original_FILE_DESCRIPTION) OR ("FILE_DESCRIPTION" IS NULL AND :original_FILE_DESCRIPTION IS NULL)) AND (("INDENTER" = :original_INDENTER) OR ("INDENTER" IS NULL AND :original_INDENTER IS NULL))" ConflictDetection="CompareAllValues">
<UpdateParameters>
<asp:Parameter Name="INDENT_ID" Type="Decimal" />
<asp:Parameter Name="FILE_NO" Type="String" />
<asp:Parameter Name="FILE_DESCRIPTION" Type="String" />
<asp:Parameter Name="INDENTER" Type="String" />
<asp:Parameter Name="original_FILE_NO_ID" Type="Decimal" />
<asp:Parameter Name="original_INDENT_ID" Type="Decimal" />
<asp:Parameter Name="original_FILE_NO" Type="String" />
<asp:Parameter Name="original_FILE_DESCRIPTION" Type="String" />
<asp:Parameter Name="original_INDENTER" Type="String" />
</UpdateParameters>
詳細ビュー:
<asp:DetailsView ID="DetailsView2" runat="server" AutoGenerateRows="False" DataKeyNames="FILE_NO_ID" DataSourceID="SqlDataSource2" Height="50px" Width="287px" >
<Fields>
<asp:BoundField DataField="FILE_NO_ID" HeaderText="FILE_NO_ID" ReadOnly="True" SortExpression="FILE_NO_ID" Visible="False" />
<asp:BoundField DataField="INDENT_ID" HeaderText="INDENT_ID" SortExpression="INDENT_ID" Visible="False" />
<asp:BoundField DataField="FILE_NO" HeaderText="FILE_NO" SortExpression="FILE_NO" />
<asp:BoundField DataField="FILE_DESCRIPTION" HeaderText="FILE_DESCRIPTION" SortExpression="FILE_DESCRIPTION" />
<asp:BoundField DataField="INDENTER" HeaderText="INDENTER" SortExpression="INDENTER" />
<asp:CommandField ShowEditButton="True" ButtonType="Button" />
</Fields>
</asp:DetailsView>
しかし今、編集ボタンを押してフィールドを編集してから更新すると、そのフィールドのデータは同じままです。何もしないことを意味します。