Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inserting data into tables
Message
From
04/12/2003 17:06:46
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00855959
Message ID:
00856095
Views:
17
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
Previous
Reply
Map
View

Click here to load this message in the networking platform