title: How to Insert Data into Two Tables Using VB.NET?
body: <p>I have a problem on how to insert data into two different table. So my requirements is this.</p>
  
  <ul>
  <li>The user will fill out all the needed information under Employee Information then in order to save the data the user will click the SAVE button. Under Group Details, The user need to click all the needed information on the dropdown menu and input on the textbox of the table grid view before clicking the ADD Link, after this the page will load displaying the Added Job Title and business group details. The user is allowed to input as many Job title as the user want. Last is the Add New Employee to Headcount list, the user need to click the PROCEED button in order to add the headcount of the added Employee Information.
  I already finished the table but I have problems in saving the data that I input.</li>
  </ul>
  
  <p>So my first table looks like this <a href="https://i.stack.imgur.com/MEDzb.png" rel="nofollow noreferrer">Before</a> and I edit it and now this is my table <a href="https://i.stack.imgur.com/dLuFV.png" rel="nofollow noreferrer">Now</a></p>
  
  <p>So my problem is this, in my database i have two table.</p>
  
  <pre><code>EMP_MASTERTBL has these columns
  
   SEQID | MASTERID | firstname | lastname | Country | JOBTITLE
  
  and EMPGROUP_TBL has these columns
  
  MASTERID | business_unit | division | Sub_Division
  </code></pre>
  
  <p>Now everytime I click save the jobtitle will not be able to save in the <code>EMP_MASTERTBL</code> so I create a code in VB.Net that will update the <code>EMP_MASTERTBL</code> table when I click the add button under Group Details.</p>
  
  <p>Here's my codes.</p>
  
  <pre><code>If UpdateInsDelRecord("INSERT INTO EMPGROUP_TBL (MASTERID, BUSINESS_UNIT, " &amp; _
                    "DIVISION, SUB_DIVISION, CLASSIFICATION, SUB_CLASSIFICATION) VALUES " &amp; _
                    "('" + HandleQuote(Me.lblval_Empid.Text) + "', " &amp; _
                    "'" + Me.ddl_BusinessUnit.SelectedValue.ToString() + "' ," &amp; _
                    "'" + val_division + "' ," &amp; _
                    "'" + val_subdivision + "' ," &amp; _
                    "'" + Me.ddl_Classification.SelectedValue.ToString() + "' ," &amp; _
                    "'" + Me.ddl_SubClassification.SelectedValue.ToString() + "')" &amp; _
                    ";" &amp; _
                     "UPDATE EMP_MASTERTBL SET JOBTITLE = '" + Me.txtJobtitle.Text + "' " &amp; _
                     "WHERE MASTERID = '" + Me.lblval_Empid.Text + "'") = True Then
      Return True
      Response.Redirect("eHR_EmpMaintenance.aspx")
  Else
      Return False
  End If
  </code></pre>
  
  <p>But the user must be able to add as many as Jobtitle as the user want. So I'm thinking that I'll just write another query for that? How can I add the Group Details and be able to add as many as Jobtitle as the user want? Help me with this please.</p>
  
  <p>Thanks.</p>