I'll try again...

  • Thread starter Rex the Strange
  • 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>
 
M

Mark Fitzpatrick

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top