update database


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: update database

  1. #1
    Join Date
    Jul 2006
    Posts
    18

    update databse

    dear all,

    although i thought i had the righte code to insert a record in a acces database using ado.net it is not showing up in the datagridview and is not actually stored in the database. this code is used when user pushes button

    Dim NEWROW As OverallkluisDataSet.GENENBANKRow
    NEWROW = Me.OverallkluisDataSet.GENENBANK.NewRow

    NEWROW.GEWAS = "WINTERTARWE"
    NEWROW.NAAM = "ALFKI"
    NEWROW.OOGSTJAAR = "2004"

    Me.OverallkluisDataSet.GENENBANK.Rows.Add(NEWROW)

    Me.OverallkluisDataSet.GENENBANK.AcceptChanges()
    Me.GENENBANKTableAdapter.Update(Me.OverallkluisDataSet.GENENBANK)
    Me.GENENBANKTableAdapter.Fill(Me.OverallkluisDataSet.GENENBANK)

    Me.MAINDataGridView.Refresh()


    where am i missing the point?

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    According to this page: http://msdn2.microsoft.com/en-us/lib...12(VS.80).aspx, you do not need to call AcceptChanges, Fill or Refresh. Simply add the new row to the DataSet and call the TableAdapter's Update method.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. Replies: 0
    Last Post: 06-04-2002, 11:13 AM
  2. update query
    By an in forum Database
    Replies: 0
    Last Post: 05-08-2002, 02:12 PM
  3. Replies: 0
    Last Post: 05-07-2002, 09:34 PM
  4. UPDATE for multiple tables
    By Kay in forum Database
    Replies: 1
    Last Post: 07-04-2001, 05:50 AM
  5. Urgent!!! ADO Update conflict
    By Chillu in forum VB Classic
    Replies: 0
    Last Post: 07-14-2000, 01:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center