What tableAdaptor should this query be in?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andy B

    What tableAdaptor should this query be in?

    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)?


  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: What tableAdaptor should this query be in?

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


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Andy B" <a_borka@sbcglo bal.netwrote in message
    news:O9l4%23vpM IHA.1208@TK2MSF TNGP05.phx.gbl. ..
    >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)?
    >

    Comment

    Working...