Submit datagrid changes

cicii

New Member
Hello,<BR><BR>I have a datagrid that can have several rows of data that are all updatable at once. The datagrid is in a form on my page. When I use a standard submit button how can I go through each of the records and update the database to reflect the changes?<BR><BR>Here is basically what I have.<BR>On Page_Load in my aspx.cs page I've got:<BR><BR>// get sample info<BR>SampleDB sample= new SampleDB ();<BR>sampleDataGrid.DataSource = sample.GetSampleInfo(sampleID);<BR>// GetSampleInfo returns a SqlDataReader that contains the <BR>//results from running a stored procedure<BR>sampleDataGrid.DataBind();<BR><BR>// my aspx page looks like this<BR><ASP:DataGrid id="sampleDataGrid" runat="server"<BR> AutoGenerateColumns="false"<BR>><BR> <Columns><BR> <asp:TemplateColumn HeaderText="Choices"><BR> <ItemTemplate><BR> <MyDropDown:CustomDropDown runat="server"<BR> nDropDownID=2 id="SampleChoices"<BR> dropDownType="choicelist" <BR> nSelected=<%# DataBinder.Eval<BR> (Container, "DataItem.id") %> <BR> /> <BR> </ItemTemplate><BR> </asp:TemplateColumn><BR><BR> <asp:TemplateColumn HeaderText="Description"><BR> <ItemTemplate><BR> <asp:TextBox id="sample_descr" runat="server" <BR> Text='<%# DataBinder.Eval <BR> (Container, "DataItem.sample_descr") %>'<BR> Size="35"<BR> /><BR> </ItemTemplate><BR> </asp:TemplateColumn><BR> </Columns><BR></asp:Datagrid><BR><BR>Thanks for any help, I really appreciate it.<BR><BR>Thanks,<BR>Nick
 
Back
Top