473,594 Members | 2,770 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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)?
Nov 29 '07 #1
1 1143
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]
- mv*@spam.guard. caspershouse.co m

"Andy B" <a_*****@sbcglo bal.netwrote in message
news:O9******** ********@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)?

Nov 29 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3065
by: Steve | last post by:
Hi, I currently display all the data on a website using tableadaptors and objectdatasources. Would it be significantly faster if I was to display the data by writing the code for a datareader and connecting to the database directly and populating my tables that way? Or is the tableadaptor using a datareader anyway for simple select statements?
0
1009
by: G .Net | last post by:
Hi Can anybody give me a step by step guide on how to access a sql DataAdaptor via the new TableAdaptor in VS2005? More specifically, I want to override RowUpdated and I can't see how to do it in VS2005. Thanks in advance
2
1776
by: Andy B | last post by:
Is there an easy way to convert tableAdaptor queries into stored procs without messing up the dataTables in the dataSet or losing the queries themselves?
0
1023
by: Andy B | last post by:
How do you put more than 1 sql query in a single tableAdaptor query?
0
8366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8227
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6646
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5402
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3853
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3893
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2383
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1469
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1203
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.