Delete data from table.

johmolan

Well-known member
Joined
Oct 11, 2008
Messages
129
Programming Experience
Beginner
Can someone please hep me.

I have a database with 17 tables, I need to replace the data in those tables.

I use the update method lik this example:

BorEndr.BoringTableAdapter.Update(Database4DataSet1.Boring)
But I need to clear "delete" rhe database first.

I tried to use the method:
BorEndr.BoringTableAdapter.Delete(Database4DataSet1.Boring)

But that did not work.

What am I doing wrong?
 
In your tableadapter, right click it and choose:

Add Query..
-> Add a Delete Query..
-> DELETE FROM table
-> Name the query DeleteAllData
-> FInish


Now call:

BoringTableAdapter.DeleteAllData()



-

So far the only delete query in your tableadapter is a parameterized one for deleting certain rows. You need to add another that has no parameters, and just deletes everything... THen call that
 
Back
Top