Working with BindingSource & AddNew

  • Thread starter Thread starter Dustin Davis
  • Start date Start date
D

Dustin Davis

I'm trying to add a new row to my database using the BindingSource. I
assume it is possible...

Below is my code snippet:


Dim drvZone As DataRowView
Try
drvZone = Me.ZonesBindingSource.AddNew()
drvZone.Row.Item(1) = ProcessID
drvZone.Row.Item(2) = Me.txtTop.Text
drvZone.Row.Item(3) = Me.txtLeft.Text
drvZone.Row.Item(4) = Me.txtBottom.Text
drvZone.Row.Item(5) = Me.txtRight.Text
drvZone.Row.Item(6) = Me.txtZoneName.Text
Me.ZonesTableAdapter.Update(Me.DsZones)
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical)
End Try



I don't get any errors, but it also doesn't add a record to the
database. Can anyone tell me what I'm doing wrong, or how to go about
adding a record to the database using the BindingSource, or should I go
about it another way?

Thanks,
Dustin
 
How did you solve the problem? I think that I'm running into the same thing.
Thanks,

Matt
 
Back
Top