I am hoping that someone from the forum is familiar with the Doing Objects in Visual Basic 2005 book so that this question makes a little more sense. I have completed the sample project and understand most of what I have done. There are some holes in my knowledge but I am sure I will pick up those pieces as I become more familiar with object orientated programming.

The sample project is an almost complete application where you view and edit Objects that are stored in a database. The author leaves the remaining features needed up to the reader, which is great because I have been able to put new knowledge into use. However I am having trouble saving a new object back to the database.

I think this is the proper way to add a new object to the binding source
VB Code:
  1. Public Function ProcessNew() As Boolean Implements IMDIChild.ProcessNew
  2.         Dim myGoal As Goal = TryCast(GoalBindingSource.AddNew, Goal)
  3.         myGoal.Save()
  4.     End Function

And I think this block of code from the Class has everything it needs to save back to the database
VB Code:
  1. Public Function Save() As Boolean
  2.         Dim dt As DataTable = DAC.ExecuteDataTable(My.Resources.sp_Update, _
  3.             DAC.Parameter(CN_GoalID, GoalID), _
  4.             DAC.Parameter(CN_Goal, Goal), _
  5.             DAC.Parameter(CN_RowState, EntityState.ToString))
  6.         If EntityState = EntityStateEnum.Added Then
  7.             GoalID = CType(dt.Rows(0).Item(CN_GoalID), Integer)
  8.         End If
  9.         DataStateChanged(EntityStateEnum.Unchanged)
  10.         Return True
  11.     End Function
By looking at this code it appears that I can save the data that is in the bindingsource by changing the EntityState to the Enum added. However I am not sure where to set it. I am pretty confident that I have the rest of this correct because when I try to do the save I get an error that the stored procedure is expecting the GoalID.