Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 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
 
Old May 8th, 2006, 02:47 AM
Authorized User
 
Join Date: Mar 2006
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to kalchev
Default Insert record Into 2 related tables at once

Hello,

I have 2 related tables named "Orders" and "order details" and the relation is one Order can have many Order Details. I need to insert single values in the Order and a datatable into an OrderDetails. Is it possible and how can I make it. And link or excample will be great:)

Thank You,
G. Kalchev
 
Old May 8th, 2006, 01:48 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

if you have the values you want to insert stored in the datatable, then you just need to loop through the datatable and construct your Insert statment and exectue it for each pass of the loop.

 
Old May 9th, 2006, 05:10 AM
Authorized User
 
Join Date: Mar 2006
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to kalchev
Default

I sloved it with using "select @@identity"

Thanks you for your time :)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting related tables to excel crisan Access 10 July 24th, 2012 04:23 PM
single submit to related tables forumuser BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 10 December 2nd, 2007 10:29 AM
how Insert record into two tables mfarooqw ASP.NET 1.0 and 1.1 Basics 2 July 10th, 2007 05:38 PM
Synchronising Two Sets of Related Tables Odeh Naber Access 11 May 14th, 2007 06:58 AM
Insert on 2 Related tables question acdsky Classic ASP Databases 1 July 21st, 2004 09:29 PM





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