database linked to vb2005 need to write better code for binding navigator

dem

Member
Joined
Dec 10, 2008
Messages
7
Programming Experience
Beginner
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
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:
anyone to help pls is needed soon pls.PLEASE NOTE THAT THE REQUIREMENTS CHANGE.Read it again pls
 
Last edited:
i mean i want to write a code for save delete and update and this line in the navigator bindings make me problem

Private Sub Form3_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)


provide to me a "disk or network error "and is unable to comple the form when i remove the line above binding menus are disable and is all ok but i want the binding navigator hel p pls
 

Latest posts

Back
Top