0

I have a gridview displaying data by using an Obejct Data Source which is then connected to a Business Layer.

The data shown/retrieved is from two tables with a join.

Is it possible to have a custom update method which, when the user clicks edit against the row, it will update only the one table out of the two that's required for the data shown (however if it can update the entire record that's fine too)? If yes how do i tie the ODS, along with my BL? Any info would be appreciated as my research so far has not given any examples of this.

To give an example one table is a user and the other table is results. The Results table is connected to the Users table by a UserID (foreign key) but the gridview shows a little more info when both tables are joined.

Eugene Pavlov
  • 688
  • 5
  • 18
Computer
  • 2,149
  • 7
  • 34
  • 71
  • ODS are huge piles of steaming shit with shrooms growing out of it, and not the good shrooms either – Steve's a D Apr 02 '13 at 14:47
  • @Steve any evidence to your answer? – Zo Has Apr 02 '13 at 14:52
  • @DamienJoe Its a comment, not an answer. A quick search (either google or SO) brings up countless evidence. Ex: http://stackoverflow.com/questions/4485946/if-objectdatasource-isnt-the-answer-for-a-large-application-what-is http://discuss.joelonsoftware.com/default.asp?dotnet.12.470916.4 – Steve's a D Apr 02 '13 at 14:57

1 Answers1

0

You can place a linkbutton inside a template field & give it CommandName="MyUpdate". You can then check for the commandName on rowCommand event of gridview & handle your custom update there.

if(e.CommandName =="MyUpdate")
{
      // Perform your update
}
Zo Has
  • 12,599
  • 22
  • 87
  • 149