views:

242

answers:

1

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" />
   </SelectParameters>
</asp:SqlDataSource>
A: 

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?

Bravax
Thanks for the reply. I'm up against a deadlilne.My SqlDataSource control DataSourceMode i DataSet. In my VB code I only call Page_Load.