开发者

ASP VB .NET SqlDataSource Update Error Fails

开发者 https://www.devze.com 2022-12-15 20:43 出处:网络
In VS 2005, using VB, page has a FormView linked to an SqlDataSource. When data is changed and Update button pressed, changed data is cleared in FormView but database table is not updated. Below is th

In VS 2005, using VB, page has a FormView linked to an SqlDataSource. When data is changed and Update button pressed, changed data is cleared in FormView but database table is not updated. Below is the SqlDataSource code. Any ideas why the Update doesn't work?

<asp:SqlDataSource ID="SqlDataDetails" runat="server" ConflictDetection="CompareAllValues"
   ConnectionString="<%$ ConnectionStrings:ALFSConnectionString %>" 
   ...
   ...
   OldValuesParameterFormatString="original_{0}" 
   ProviderName="<%$ ConnectionStrings:ALFSConnectionString.ProviderName %>"
   SelectCommand="SELECT * FROM [Resident] WHERE ([Resident_ID] = ?)" 
   UpdateCommand="UPDATE [Resident] SET [Resident_Company_ID] = ?, ..., [Resident_Diet] = ?, [Resident_Social_Security] = ? WHERE [Resident_ID] = ?" >
   <UpdateParameters>
      <asp:SessionParameter Name="Resident_ID" SessionField="Resident_ID" Type="String" />
      <asp:Parameter Name="Resident_Company_ID" Type="Int32" />      ...            
      ...            
      ...            
      <asp:Parameter Name="original_Resident_Diet" Type="String" />
      <asp:Parameter Name="original_Resident_Social_Security" Type="Int32" />
   </UpdateParameters>
   ...            
   ...            
   <SelectParameters>
      <asp:SessionParameter Name="Resident_ID" SessionField="Resident_ID" Type="String" />
   </Select开发者_开发知识库Parameters>
</asp:SqlDataSource>


Have a look here: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.sqldatasource.aspx

What is your DataSourceMode, and/or are you calling .Update() if applicable?

0

精彩评论

暂无评论...
验证码 换一张
取 消