By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
The solution is similar to that one. You have to iterate the grid rows and update the Dataset accordingly. The C# code I showed for that, would be in VB:
If (Page.IsValid) Dim ds As DataSet = CType(Session["data"], DataSet) Dim item As DataGridItem //Iterate and apply changes to the dataset For Each item In DataGrid2.Items Dim mytxt As TextBox = CType(TextBox, item.FindControl("myTxtBox")) // We may want to check if something has actually changed here... ds.Tables(0).Rows(item.ItemIndex)("myfield") = mytxt.Text; Next // Perform the update. sqlDataAdapter1.Update(ds); // Reload the grid. DataGrid2.DataBind(); End If
Dig Deeper on .NET Framework database programming best practices
Related Q&A from Daniel Cazzulino
Here Daniel Cazzulino explains how to load a DSL (domain specific language) domain model instance file programmatically. This requires the .NET type ...continue reading
Here we offer a glimpse at 12 of .NET development expert Danny Cazzulino's top ASP.NET questions and answers.continue reading
C# developers should NOT be modifying InitializeComponent method in the code-behind (or any of the variable definitions) by hand.continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.