Click here to Skip to main content
12,405,303 members (64,184 online)

ineer join in access in vb.net how to update tow table

monemdb asked:

Open original thread
im making tow table where ineer join connect awanted to save and update an iwanted to change in my program and update it this is my cod to connect
try
    cmd.CommandText = "SELECT Employee.Emp_ID ,Employee.Emp_Name ,Employee.Emp_Tel , Dep_Name FROM Employee , Department where Employee.Dep_id = Department.Dep_id "
 
    DataAdapter1 = New OleDbDataAdapter(cmd)
    Dim builder As New OleDbCommandBuilder(DataAdapter1)
 
    DataSet1 = New DataSet()
 
    'Load some data into the DGV
    DataAdapter1.Fill(DataSet1, "DataTable1")
    BindingSource1 = New BindingSource(DataSet1, "DataTable1")
    BindingSource2 = New BindingSource(DataSet1, "DataTable1")
 
    Label7.DataBindings.Add("Text",
    BindingSource1, "Emp_ID", True, 1, "")
 
    TextBox1.DataBindings.Add("Text", BindingSource1, "Emp_Name", True, 1, "")
    TextBox2.DataBindings.Add("Text", BindingSource1, "Emp_Tel", True, 1, "")
    TextBox3.DataBindings.Add("Text", BindingSource1, "Dep_Name", True, 1, "")
    ' TextBox4.DataBindings.Add("Text", BindingSource1, "price", True, 1, "")
    ' TextBox5.DataBindings.Add("Text", BindingSource1, "total", True, 1, "")

    DataGridView1.DataSource = BindingSource1
    ComboBox1.DataSource = BindingSource1
    ComboBox1.DisplayMember = "Emp_Name"
    ComboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend
    ComboBox1.AutoCompleteSource = AutoCompleteSource.ListItems
 
    DataGridView1.Columns(0).Width = 40
    DataGridView1.Columns(1).Width = 100
    DataGridView1.Columns(2).Width = 70
    DataGridView1.Columns(3).Width = 70
    ' DataGridView1.Columns(4).Width = 70
    ' DataGridView1.Columns(5).Width = 100

    DataGridView1.Columns(0).HeaderText = "?????"
    DataGridView1.Columns(1).HeaderText = "?????"
    DataGridView1.Columns(2).HeaderText = "??????"
    DataGridView1.Columns(3).HeaderText = "??????"
    ' DataGridView1.Columns(4).HeaderText = "?????"
    ' DataGridView1.Columns(5).HeaderText = "????????"

    DataGridView1.Columns(2).AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
    DataGridView1.Columns(0).ReadOnly = True
    DataGridView1.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
    DataGridView1.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
    DataGridView1.Sort(DataGridView1.Columns(1), System.ComponentModel.ListSortDirection.Ascending)
    count()
Catch ex As Exception
    MessageBox.Show(ex.Message, "?????", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
and this code make proplem to update tow taple

buton _click
If BindingSource1.Count = 0 Then Beep() : Exit Sub
    BindingSource1.EndEdit()
    DataAdapter1.Update(DataSet1, "DataTable1 ")
    count()
Tags: VB, VB.NET, Access

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the The Code Project Open License (CPOL).



Advertise | Privacy | Mobile
Web01 | 2.8.160721.1 | Last Updated 26 Mar 2009
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100