How to use an object to travel data from one form to another

Tags:
DataGrid
DataGridView
VB DataGrid
VB.NET
Hi,
I have two forms.Both having DatagridView.There are two comboboxes to filter the record from Database and fill in Datagridview.My requirement is when all the data is populated in DataGrid after selecting the comboboxes and when the user clicks on Delete.
The comboboxes and Datagrid on second form should have the same values as that was on first form.The names of my Comboboxes and Datagridview are same on both the forms
Below is the code my Datagrid view getting populated in First Form.
Sub GetData(ByVal StrQuery As String)

        If CBMedium.Text <> "" And CBClass.Text <> "" Then
            DGVStudRecord.Rows.Clear()
            con = DBConnect()
            cmd = New SqlCommand(StrQuery, con)
            dr = cmd.ExecuteReader
            If dr.HasRows Then
                While dr.Read
                  
                    DGVStudRecord.Rows.Add(dr(0), dr(1), dr(2), dr(3), dr(4), dr(5))
                End While
            End If
            con.Close()
        
        End If
    End Sub
Please suggest how can i populate my datagrid in second form by using the Data populated in Datagrid of Firrt Form


Software/Hardware used:
Miscrosoft Visual Studio

Answer Wiki

Thanks. We'll let you know when a new response is added.

Without DNS, computers would have a very tough time communicating with each other. However, most Windows administrators still rely on WINS for name resolution on local area networks and some have little or no experience with DNS. Steven Warren explains how to install, configure, and troubleshoot a Windows Server 2008 DNS server.
You can install a DNS server from the Control Panel or when promoting a member server to a domain controller (DC) (Figure A). During the promotion, if a DNS server is not found, you will have the option of installing it.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following