Results 1 to 5 of 5

Thread: Update row in database

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2013
    Posts
    21

    Update row in database

    Hi all,

    I've been trying to update data in my table.
    This is my code
    Code:
        Private Sub Taalkeuze_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            'Fill Table
            Me.GebruikersTableAdapter.Fill(Me.EasybyteDataSet.Gebruikers)
            Me.Top = (Screen.PrimaryScreen.WorkingArea.Height - Me.Height) / 2
            Me.Left = (Screen.PrimaryScreen.WorkingArea.Width - Me.Width) / 2
        End Sub
    
        Private Sub pcbNed_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pcbNed.Click
            EasybyteDataSet.Gebruikers(0).Item("Taal") = "NED"
            gstrTaal = "NED"
            Laadscherm.Show()
            Laadscherm.cntTeller.Enabled = True
            Me.Close()
        End Sub
    So when a user clicks the image it should update the table "Gebruikers" on index 0 and the item "Taal" to NED.
    However it doens't seem to work.

    Can anyone help me out?
    Thanks

  2. #2

    Re: Update row in database

    Well...of course it doesn't work. You didn't tell it to do anything. You set the values, but that's it. You didn't tell it to update back to the database so of course it won't do anything! I recommend looking up a few database tutorials involving DataSets on Bing or Google before going any further with what you're doing.

    Also, as a side note, there is a Property for the form that will start the form in the center of the screen. I forgot what the property name was, but I'm sure a quick search can find it.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2013
    Posts
    21

    Re: Update row in database

    Well I fixed it myself.
    I forgot to add that it should update the tableadapter. Dumb me!

  4. #4

    Re: Update row in database

    Quote Originally Posted by DryGoldFish View Post
    Well I fixed it myself.
    I forgot to add that it should update the tableadapter. Dumb me!
    Foiled once again by hindsight!!

  5. #5

    Thread Starter
    Junior Member
    Join Date
    May 2013
    Posts
    21

    Re: Update row in database

    And also, thank you for the side note. I found the property.
    It's called: StartPosition.

    Thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width