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
arameter Name="projectid" Type="Int32" />
<asp
arameter 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>
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
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
</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>