KingAce Posted June 30, 2005 Posted June 30, 2005 This code doesnt seem to be working for adding a new record: Dim newcourse As Data.DataRow newcourse = NewCourse1.Tables(0).NewRow newcourse.Item("Name") = TextBox1.Text NewCourse1.Tables(0).Rows.Add(newcourse) NewCourse1.AcceptChanges() OleDbDataAdapter1.Update(NewCourse1, "Course") Why not? TIA Quote
bri189a Posted June 30, 2005 Posted June 30, 2005 This code doesnt seem to be working for adding a new record: Dim newcourse As Data.DataRow newcourse = NewCourse1.Tables(0).NewRow newcourse.Item("Name") = TextBox1.Text NewCourse1.Tables(0).Rows.Add(newcourse) NewCourse1.AcceptChanges() OleDbDataAdapter1.Update(NewCourse1, "Course") Why not? TIA Because you called AcceptChanges(). Update will call it for you after it calls the appropriate Insert command internally. Quote
KingAce Posted June 30, 2005 Author Posted June 30, 2005 Because you called AcceptChanges(). Update will call it for you after it calls the appropriate Insert command internally. i feel like such an idiot. thanks alot Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.