What tableAdaptor should this query be in?

  • Thread starter Thread starter Andy B
  • Start date Start date
A

Andy B

I have a delete query that spans 2 tables: NewsArticles and NewsHeaders. I
am trying to figure out what tableAdaptor to put the delete query under
since it deals with 2 tables. Should it be in the NewsArticles table since
thats what it does? is delete newsArticles? or should it be in the
NewsHeaders table since it has to unlink categores from the news articles
first (or does it even matter)?
 
Well, you should really have two table adapters, one to delete the news
articles, and one to delete the news headers.

Then, you wrap it up in a method that when it deletes news headers, you
delete the associated news articles, or whatever you need to do to enforce
the relationship between the two tables (I'd recommend wrapping this in a
transaction as well).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top