Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inserting data into tables
Message
De
04/12/2003 17:06:46
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00855959
Message ID:
00856095
Vues:
18
Rick,

I'm guessing you need an EndEdit() after you've inserted your row. Try this:
    Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNew.Click
        'create new record
        'add a blank record to the DataSet,
        'with the appropriate Unique_ID
        '(the field is set to autonumber so is it necessary to supply a unique_id?)
        'then add the record to the table via the save button.

        lAdding = True

        WorkRow = dstNwind.Tables(0).NewRow()
        dstNwind.Tables(0).Rows.Add(WorkRow)

        ' NEW LINE OF CODE
        WorkRow.EndEdit()

        LastRecord()
        txtFirstName.Text = ""
        txtLastName.Text = ""
    End Sub
This sort of thing can also be done with the BindingContext's .EndCurrentEdit() method. Anyway, I think that's where your problem lies.

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform