Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #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.
================================================== =========


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





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