need access database help *noob*

crustache

Member
Joined
Jul 16, 2007
Messages
5
Programming Experience
Beginner
Hey guys, I need some help, I'm developing a real simple app with some text boxes and combo boxes. I am trying to write data back to an access database i set up. It's my understanding that using tableadapter.update i can update my database. But when I try i always get

'update' is not a member of 'WindowsApplication1.northwindDAtaSEtTAbleAdapters.nwTableAdapter'

here's the cmd click

Private Sub NwBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NwBindingNavigatorSaveItem.Click
Me.NwTableAdapter.update(Me.NorthwindDataSet.nw)
End Sub

i know it's very basic but what is wrong with it?
 
.Update() doesnt exist because the nw table is not modifiable, the DELETE, UPDATE AND INSERT sql commands were not generated and hence there is no point generating the Update() method because this tableadapter is not capable of modifying data.

Perhaps the tableadapter is based on a view or some other object that cannot be manipulated
 
Last edited:
did u set ur primary key?

and by the way u forgot 2 lines of codes, refer to DW2 of cjard's signature
 
did u set ur primary key?
It is unlikely to be such a case. Tables without a PK can still have an INSERT statement generated, which means that the Update() will be present, but attempting to use it on a collection with modified or deleted rows will give a message to the effect of "adapter requires an UPDATE/DELETE statement when passed a collection with modified/deleted rows"

and by the way u forgot 2 lines of codes, refer to DW2 of cjard's signature

Good point; omitting Me.Validate() and <bindingsource>.EndEdit() might mean that uncommitted rows are not sent to the database
 
Back
Top