title: Dynamaically adding Values from Bound Controls into New Datatable Row
body: <p>I'm still pretty green when it comes to vb.net and programming in general, so I apologize ahead of time if this is general knowledge.</p>
  
  <p>Scenario, I am dynamically creating the control's bindings, filling a datatable with my SQL tables Schema. At this point I want to be able to fill in my form and have those values populate my datatable.</p>
  
  <p>So far my solution is to add a new datarow and then assign values to each field. This seems a little redundant because I already have the fields bound. Is there a trick to filling a datatable with values from a bound control?</p>
  
  <p>What I am doing for binding:</p>
  
  <pre><code>boundSource.DataSource = myDataSet
  boundSource.DataMember = myDataTablesName
  me.ClientNumber.DataBindings.Add(New Binding("Text",boundSource, "Client_Number")
  ...
  </code></pre>
  
  <p>The above works fine when I populate the datatable form SQL, but when I am trying to add a new record I have to add the various control.values/text to the datatable.</p>
  
  <p>I am using a sqlDataadapter with a commandbuilder to generate the Insert, Update and Delete. I believe the relevant code is:</p>
  
  <pre><code>            Me.ValidateChildren()
              bounndSource.EndEdit()
              curCon.Open()
              daClientMaster.Update(ds, "CLIENT_MASTER")
              dt.AcceptChanges()
  </code></pre>
  
  <p>I would assume if I have 4 controls of varying types (text, date, etc.) and they are bound to specific fields in a datatable, that when I start the application I am starting on a new row of the datatable. So when I enter the information into the controls and then use the dataadapter update for said datatable, it would know to Insert. and really this is where the problem may lie. I am in way over my head, with too many task to accomplish, I have no time to fully understand anything I am doing (or maybe that's just programming in general.) If I am lacking an understanding of Databinding, or anything else, guidance to the correct information would be appreciated.</p>
  
  <p>Thanks in advance
  PC</p>