Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy dataset

Status
Not open for further replies.

SMURF75

Programmer
Aug 28, 2004
87
GB
Hi!

The thing im trying to do here is to use dsOldSession as a copy of dsSession, so if user returns from fRefill he can work with the dsSession again without the changes i do before i show frmRefill

Code:
Public dsSession as New Dataset
Private dsOldSession as New Dataset

Private Sub btnRefill_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRefill.Click
        Try

            Dim fRefill As New frmRefill

            dsOldSession = dsSession

            Dim drSession As DataRow
            dsSession.Tables("Data").Columns.Add("Event",_ System.Type.GetType("System.String"))

            drSession = dsSession.Tables("Data").Rows(0)
            drSession("Event") = "Refill"
            
            fRefill.dsSession = dsSession
            fRefill.ShowDialog()
            fRefill.Dispose()
            dsSession = dsOldSession

        Catch ex As Exception
        End Try
    End Sub

Ive tried some ways... this one seems like it should be right... but its not.

- - - - - - - - - - - - - - - - - -
Im three apples high, Im blue, and i most certainly like that cold beer that should be every mans right after a hard days work!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top