ninjaimp 8 Junior Poster

Hi

I have a form which adds data to a dataset, which can be viewed in a datagrid as it happens and then they finish and this adds it to the database - but after a short while the data that was added seems to rdissapear ffrom the database! Wondered if anyone could see where i may have gpne wrong!

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim drNew As System.Data.DataRow

        drNew = Me.UrlsDataSet.AllowedUrls.NewRow
        drNew.Item("URL") = urlTextBox.Text
        Me.UrlsDataSet.AllowedUrls.Rows.Add(drNew)

        Changes = True
        
    End Sub

    Sub AddData() ' add the new urls to the database

        Me.Validate()
        Me.AllowedUrlsBindingSource.EndEdit()
        Me.AllowedUrlsTableAdapter.Update(Me.UrlsDataSet.AllowedUrls)

        MsgBox("All new data added successfully!")

        Me.Close()

    End Sub