Hello i have make a Project in vb linked with vb 2005 i make a form about Customers and the form is load automaticly the Binding navigator i want to UPDATE (MAKE BETTER CODE)
This is the code i have now pls help ME TO WRITE BETTER
i update the requirement i need i dont like anymore to remove the databindings but write a beteer code for add save delte and where the form is loaded to not load the first person that is in the customer table (Empty)
This is the code i have now pls help ME TO WRITE BETTER
VB.NET:
Public Class Form1
Dim instance As OleDb.OleDbConnection
Private Sub CustomersBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CustomersBindingNavigatorSaveItem.Click
Me.Validate()
Me.CustomersBindingSource.EndEdit()
Me.CustomersTableAdapter.Update(Me.Db1DataSet.Customers)
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 'Db1DataSet.Customers' table. You can move, or remove it, as needed.
Me.CustomersTableAdapter.Fill(Me.Db1DataSet.Customers)
End Sub
Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label2.Click
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
CustomerIDTextBox.Text = ""
CNameTextBox.Text = ""
CSurnameTextBox.Text = ""
HomeTelTextBox.Text = ""
MobileTelTextBox.Text = ""
CountryTextBox.Text = ""
CityTextBox.Text = ""
BonusCardTextBox.Text = ""
AndressTextBox1.Text = ""
Postal_codeTextBox1.Text = ""
EmailTextBox1.Text = ""
FaxNumTextBox1.Text = ""
NotesTextBox.Text = ""
End Sub
Private Sub BonusCardTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BonusCardTextBox.TextChanged
End Sub
Private Sub AndressTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AndressTextBox1.TextChanged
End Sub
Private Sub BtnEXIT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnEXIT.Click
If MsgBox("Are You Sure You Want to Exit", MsgBoxStyle.YesNo, "Nicolaou Department Store") = MsgBoxResult.Yes Then
End
Else
MsgBox("Welcome Back", MsgBoxStyle.OkOnly, "Nicolaou Department Store")
End If
End Sub
Private Sub BindingNavigatorAddNewItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorAddNewItem.Click
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Validate()
Me.CustomersBindingSource.EndEdit()
Me.CustomersTableAdapter.Update(Me.Db1DataSet.Customers)
End Sub
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub BindingNavigatorMoveFirstItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorMoveFirstItem.Click
End Sub
i update the requirement i need i dont like anymore to remove the databindings but write a beteer code for add save delte and where the form is loaded to not load the first person that is in the customer table (Empty)
Last edited: