Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted
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.

Posted
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...