Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 30th, 2010, 08:08 AM
Friend of Wrox
Points: 1,469, Level: 15
Points: 1,469, Level: 15 Points: 1,469, Level: 15 Points: 1,469, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Smile Updating 2 tables simultaneously

Hello everyone,
I wanna know that how we can modify two tables at once.
That is what I am trying to do is that there are 3 tables
Category (Id (Primary key), Name)
Message (Id (Primary key), CategoryId (Foreign key), Subject (Not Null), Owner) and Reply (Id (Primary key), MessageId (Foreign key), Subject (Null allowed), Body, Owner)

Here Message table contains only Subject field which is different from the subject field of Reply table.
Now whenever a user wants to post a message/reply in specific category then it should first be checked that it is new message or existing message in that category.
If it is new then the subject filed should go in the Message table and Id should be returned and sent back to the Reply table and stored in the MessageId field, and body field and MessageId should then be stored in Reply table.
And if it is not new message then all messages/replies should be stored in the Reply table only for that specific message for which replies are being posted.

So please can any one tell me the procedure or code snippet that how these 2 tables can be accessed simultaneously and achieve the above functionality.

Many many thanks in advance.
  #2 (permalink)  
Old September 30th, 2010, 08:18 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Depending on your database, read about transactions on google...
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
updating linked oracle tables rashi Access VBA 2 March 9th, 2009 09:41 AM
updating SQL tables leopardj Beginning PHP 2 January 29th, 2007 06:42 AM
Updating Tables Brendan Bartley Access 1 December 20th, 2006 10:42 AM
ADO - Updating two tables? BradLee31 Pro VB 6 2 May 19th, 2004 05:39 AM
Updating Two Tables from Form Input PamS Access 6 October 30th, 2003 02:46 PM



All times are GMT -4. The time now is 05:01 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.