Friday, September 9, 2011

Friday 9.9.11

Private Sub VendorsBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VendorsBindingNavigatorSaveItem.Click
Me.Validate()
Try
Me.VendorsBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.PayablesDataSet)
Catch ex As DBConcurrencyException
MessageBox.Show("A concurrency error occurred. " & "The row was not updated.", "Concurrency Exception")
Me.VendorsTableAdapter.Fill(Me.PayablesDataSet.Vendors)
Catch ex As DataException
MessageBox.Show(ex.Message, ex.GetType.ToString)
VendorsBindingSource.CancelEdit()
Catch ex As SqlException
MessageBox.Show("SQL server error # " & ex.Number & ": " & ex.Message, ex.GetType.ToString)
End Try
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'PayablesDataSet.Vendors' table. You can move, or remove it, as needed.
Try
Me.VendorsTableAdapter.Fill(Me.PayablesDataSet.Vendors)
Catch ex As SqlException
MessageBox.Show("Sql server error # " & ex.Number & ": " & ex.Message, ex.GetType.ToString)

End Try

End Sub

No comments: