|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Working with BindingSource & AddNewassume 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 Nevermind. I figured it out.
Dustin Davis wrote: Show quoteHide quote > 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 Show quoteHide quote "Dustin Davis" wrote: > Nevermind. I figured it out. > > Dustin Davis wrote: > > 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 >
Date Sort
Sharing Class Data With Multiple Forms Urgent! Get rowindex - datagrid navigation Need to capture all keystrokes to my application Difference between MyBase and Me Limit bandwith of my application VB Net 2005 and Email! combobox view display width question Images in a Windows DataGrid how to trap/detect when entering textbox via tabkey? |
|||||||||||||||||||||||