Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8861739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:33:30+00:00 2026-06-14T15:33:30+00:00

I need help with this, I’ll try to explain it in detail as much

  • 0

I need help with this, I’ll try to explain it in detail as much as I can.

Let’s say in Form1 I have a Datagridview1 (DGV1) which is DataBound to Table1 with the columns TransactionNumber(Double), FormName (varchar), Description(varchar), Posted(text).

In Form2, I have another DGV2 which is DataBound to Table2 with the columns TransactionNumber(Double), Formname(VarChar), Description(VarChar), Quantity(Double).

In Form1 I have Textboxes to add data to the Columns in DGV1 and 2 Buttons Add and Post. When I click Post I want to loop through DGV1 and find all the data with the given TransactionNumber, then copy those data to DGV2 in Form2.

I really need help with this.. Any kind of tips or help would be greatly appreciated. Please and Thank You!

I still don’t have codes for the Button Post as I’m still trying to figure out how to do this… I’m going to update this post with codes asap..

P.S.
Still Learning

NEW QUESTION BUT STILL RELATED TO THE ORIGINAL QUESTION

I tweaked your code, it now adds data.

Could I also use this in an mdi form?

Dim occurences As New Dictionary(Of String, Double)

For Each DGVR As DataGridViewRow In Datagridview1.Rows

    If (Not DGVR.IsNewRow) Then

        If (occurences.ContainsKey(DGVR.Cells(1).Value.ToString())) Then

            occurences(DGVR.Cells(1).Value.ToString()) = Double.Parse(occurences(DGVR.Cells(1).Value.ToString()).ToString()) + Double.Parse(DGVR.Cells(4).Value.ToString())

        Else

            occurences.Add(DGVR.Cells(1).Value.ToString(), Double.Parse(DGVR.Cells(4).Value.ToString()))
        End If

    End If

Next


For Each KVP As KeyValuePair(Of String, Double) In occurences


    DataGridView2.Rows.Add(New Object() {KVP.Key, KVP.Value})

Next
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T15:33:31+00:00Added an answer on June 14, 2026 at 3:33 pm

    Don’t hate on me for this, as it is the best I could do in such a short time span:

    http://www.fileswap.com/dl/KusycS0QTC/

    Basically it’s a project with an MDI parent form and two child forms. I have a DGV on each and I transfer the info from one form to the other. You will have to make the necessary edits to account for your setup, but it should be enough to give you an idea of how to go about what you’re after.

    EDIT:

    Possible Changes:

         Dim _Name As String = ""
         Dim _Last As String = ""
    
          For Each xRow In MasterForm.oTransferRows
                _Name = xRow.Cells("GVName").Value.ToString()
                _Last = xRow.Cells("GVLast").Value.ToString()
    

    ‘Should the next line be insert into?

                Dim _sqlInsert As String = String.Format("Insert testing(Name, LastName) Values  (@iName, @iLast)")
                Using conn As New SqlClient.SqlConnection("Server = localhost; Username= root; Password =; Database = test")
                    Using cmd
                        With cmd
                            MsgBox("Connection Established")
                            .Connection = conn
                            .Parameters.Clear()
                            'Create Insert Query
                            .CommandText = _sqlInsert
    
                            .Parameters.Add(New SqlParameter("@iName", _Name))
                            .Parameters.Add(New SqlParameter("@iLast", _Last))
                        End With
                        Try
                            conn.Open()
                            Me.Validate()
                            cmd.ExecuteNonQuery()
                        Catch ex As Exception
                            MsgBox(ex.Message.ToString())
                        End Try
                    End Using
                End Using
    
            Next
    

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need help on this thing. I have 3 view controllers say Parent and
I am new to android and need help on this. I have two views
I need help refactoring this multi-loop thing. Here is what I have: Campaign has_many
I need help with this design, a Diagnosis can be based on evidence or
I am new to programming in python and need help doing this. I have
Need help with this error. Can't see what's wrong. Error: Warning: mysql_query() expects parameter
I need help with this loop through an array. Right now I have 3
I need help with this. I have a database that displays product type titles.
I need help with this problem. I need someone to explain to me why
Need help figuring this out. I have two tables user ---- name skills (comma

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.