I'll try again...

  • Thread starter Thread starter Rex the Strange
  • Start date Start date
R

Rex the Strange

Why does this not work? Anyone, please...

According to the Visual Studio (2005) documentation this should work
but, while it does not report any errors, it does not update the
database, either.

So, please, anyone, why does this not work?

tia,

rts

<asp:SqlDataSource ID="project_source" runat="server"
OldValuesParameterFormatString='old_{0}'
ConnectionString="<%$ ConnectionStrings:Access Database Test
Connection %>"
ProviderName="<%$ ConnectionStrings:Access Database Test
Connection.ProviderName %>"
UpdateCommand="Update projects set name=@name where
projectid=@old_projectid"
SelectCommand="Select projects.projectid, projects.name from
projects">
<UpdateParameters>
<asp:Parameter Name="projectid" Type="Int32" />
<asp:Parameter Name="name" Type="String" />
</UpdateParameters>
</asp:SqlDataSource>


<asp:FormView ID="project_formview" runat="server"
DataSourceID="project_source">
<EditItemTemplate>
<asp:HiddenField ID='projectid' runat='server' Value='<%# Bind
("projectid") %>' />
<asp:TextBox ID='name' runat='server' Text='<%# Bind ("name") %>'

MaxLength=255 Width=500 />
<asp:Button ID="update" runat="server" Text="Update Record"
CommandName="Update" />
</EditItemTemplate>


<ItemTemplate>
<asp:Button ID='update_mode' runat='server' Text='Update Mode'
CommandName='Edit' />
</ItemTemplate>
</asp:FormView>
 
Does it show the data? If it doesn't update/insert data, I would look at
permissions. Keep in mind that any file-based database, such as MS Access,
requires write permissions on the database for the ASP.Net user account. I
usually add delete permissions just in case.
 
Back
Top