data not adding to database properly!

Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Apr 2008
Posts: 115
Reputation: ninjaimp is an unknown quantity at this point 
Solved Threads: 6
ninjaimp ninjaimp is offline Offline
Junior Poster

data not adding to database properly!

 
0
  #1
Nov 19th, 2008
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!

  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2.  
  3. Dim drNew As System.Data.DataRow
  4.  
  5. drNew = Me.UrlsDataSet.AllowedUrls.NewRow
  6. drNew.Item("URL") = urlTextBox.Text
  7. Me.UrlsDataSet.AllowedUrls.Rows.Add(drNew)
  8.  
  9. Changes = True
  10.  
  11. End Sub
  12.  
  13. Sub AddData() ' add the new urls to the database
  14.  
  15. Me.Validate()
  16. Me.AllowedUrlsBindingSource.EndEdit()
  17. Me.AllowedUrlsTableAdapter.Update(Me.UrlsDataSet.AllowedUrls)
  18.  
  19. MsgBox("All new data added successfully!")
  20.  
  21. Me.Close()
  22.  
  23. End Sub
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 289 | Replies: 0
Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC