Working with BindingSource & AddNew

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
 
G

Guest

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

Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top