|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
FormView update parameter valuesupdateParameters. I can't seem to set the value of one of them from the text of a textbox in an editTemplate of the formView. Can someone help? Thanks. <asp:SqlDataSource ID="formSource" runat="server" ConnectionString="<%$ ConnectionStrings:SSConnectionString %>" SelectCommand="Select p.Description, p.CurrentStatus, pu.projUpdate, p.ID From dbo.tblProjects p left outer join tblProjectUpdates pu on p.id = pu.ProjectID where p.ID = @ID order by projUpdateDate desc" UpdateCommand="Update [tblProjects] set [Description] = @Description where [ID] = @ID"> <SelectParameters> <asp:ControlParameter Name="ID" ControlID="GridView1" PropertyName="SelectedValue" /> </SelectParameters> <UpdateParameters> <asp:Parameter Name="Description" /> <asp:Parameter Name="ID" /> </UpdateParameters> </asp:SqlDataSource> Make sure that the TextBox markup has a valid Bind statement and that the
GridView DataKeyNames property="ID". Show quoteHide quote "John Hopper" wrote: > I have a formView with a sqlDataSource. The sqlDataSource has 2 > updateParameters. I can't seem to set the value of one of them from the text > of a textbox in an editTemplate of the formView. Can someone help? Thanks. > > <asp:SqlDataSource ID="formSource" runat="server" ConnectionString="<%$ > ConnectionStrings:SSConnectionString %>" > SelectCommand="Select p.Description, p.CurrentStatus, > pu.projUpdate, p.ID From dbo.tblProjects p left outer join tblProjectUpdates > pu on p.id = pu.ProjectID where p.ID = @ID order by projUpdateDate desc" > UpdateCommand="Update [tblProjects] set [Description] = @Description where > [ID] = @ID"> > <SelectParameters> > <asp:ControlParameter Name="ID" ControlID="GridView1" > PropertyName="SelectedValue" /> > </SelectParameters> > <UpdateParameters> > <asp:Parameter Name="Description" /> > <asp:Parameter Name="ID" /> > </UpdateParameters> > </asp:SqlDataSource> Thanks so much. The Bind statement was the problem. I was using Eval. Now it
works fine. Thanks again! John Hopper Show quoteHide quote "Phillip Williams" wrote: > Make sure that the TextBox markup has a valid Bind statement and that the > GridView DataKeyNames property="ID". > -- > HTH, > Phillip Williams > http://www.societopia.net > http://www.webswapp.com > > > "John Hopper" wrote: > > > I have a formView with a sqlDataSource. The sqlDataSource has 2 > > updateParameters. I can't seem to set the value of one of them from the text > > of a textbox in an editTemplate of the formView. Can someone help? Thanks. > > > > <asp:SqlDataSource ID="formSource" runat="server" ConnectionString="<%$ > > ConnectionStrings:SSConnectionString %>" > > SelectCommand="Select p.Description, p.CurrentStatus, > > pu.projUpdate, p.ID From dbo.tblProjects p left outer join tblProjectUpdates > > pu on p.id = pu.ProjectID where p.ID = @ID order by projUpdateDate desc" > > UpdateCommand="Update [tblProjects] set [Description] = @Description where > > [ID] = @ID"> > > <SelectParameters> > > <asp:ControlParameter Name="ID" ControlID="GridView1" > > PropertyName="SelectedValue" /> > > </SelectParameters> > > <UpdateParameters> > > <asp:Parameter Name="Description" /> > > <asp:Parameter Name="ID" /> > > </UpdateParameters> > > </asp:SqlDataSource>
GridView TemplateColumn
Retrieving Values from Hidden Fileds Inside Web Controls on PostBa Accessible GridView ASP.NET datagrid Intercepting the DataGrid PREVENT an ASP.Net page from posting back when the ENTER key press System.Web.UI.WebControls.Image control not refreshing Browse for file - on the server GridView Constituents Postback and return view |
|||||||||||||||||||||||