none
dataset problem RRS feed

  • Question

  • ok ive done the standard things i do in asp environment but 
    this time im working in visual studio 2008 on a windows application
    i create my database 1 tbl (tblTest)  2columns named 1 and 2
    i add it to connections
    make a dataset
    drag the tabel from connection on the dataset
    then i use this code : 

       Dim x As New DataSet1
        Dim adapt As New DataSet1TableAdapters.tblGebruikersTableAdapter
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            adapt.Fill(x.tblGebruikers)
            Me.DataGridView1.DataSource = x.tblGebruikers
        End Sub

        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim rij As DataSet1.tblGebruikersRow
            rij = x.tblGebruikers.NewRow
            rij.gebruikersnaam = Me.TextBox1.Text
            rij.passwoorrddrdrd = Me.TextBox2.Text
            x.tblGebruikers.Rows.Add(rij)
            adapt.Connection.Open()

            adapt.Update(x.tblGebruikers)
            adapt.Fill(x.tblGebruikers)

            adapt.Connection.Close()
            Me.DataGridView1.DataSource = x.tblGebruikers
        End Sub


    and its not updating to the database
    why? this works fine in asp.net :/
    thanks for the help 
    Tuesday, February 24, 2009 4:39 PM