CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 tables

Print topic Send  topic

Author Message
alpha55

Posts: 14
Posted: 05/26/2008, 11:51 AM

hi,

can anybody tell me how to submit values to a table and then take the value of autoincrement number from that table and use it for the other table
View profile  Send private message
wkempees


Posts: 1679
Posted: 05/26/2008, 12:06 PM

Discussed frequently here on the fora
Using the SEARCH from forums top menu
Searched for 'last insert' in .NET
http://forums.codecharge.com/posts.php?post_id=90076&s_keyword=last+insert

Depends on your target database.
Also in examples some of this code is used based on the max(ID) construct, documented to be the least safe way in multiuser environment....

HTH

Walter


_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
alpha55

Posts: 14
Posted: 05/26/2008, 12:12 PM

i need it for invoicing; one table will have invoice number (auto generated) and customer details and other table will have the invoice details.

while creating invoice first invoice number needs to be generated and the same number is to be associated with the invoice details in invoice detail table.


your help is highly appreciated
View profile  Send private message
wkempees


Posts: 1679
Posted: 05/26/2008, 12:20 PM

Examples:
Press F1 Help from within CCS, in Index see Examples and Techniques->Example Pack

See
http://examples.codecharge.com/ExamplePack/MultiStepReg...trationGrid.php

explained :
http://examples.codecharge.com/ExamplePack/MultiStepReg...ration_desc.php

This is the MAx(ID) construct.

_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
alpha55

Posts: 14
Posted: 05/26/2008, 12:51 PM

i'm looking to do this with just one submit button; is it possible
View profile  Send private message
wkempees


Posts: 1679
Posted: 05/26/2008, 1:02 PM

The pace at which you post, makes me wonder if you even look at the answers...
Yes it is possible, because it is an AfterInsert event.

Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
alpha55

Posts: 14
Posted: 05/26/2008, 10:25 PM

well what i think is it has to perform 2 insert operations one after the other; the second insert process will look for the max value in the previous insert. now if you could tell me how to put up the after insert event in this case;
View profile  Send private message
alpha55

Posts: 14
Posted: 05/27/2008, 11:09 AM

hi walter;

let me try write to you in complete detail this might help you in understanding my requirement

I need to create a cart. in the cart customer selects product(s) from a drop down menu, chooses the quantity, if (s)he requires more itesm (s)he has to click on add another button to add a row to the table and repeat the process. when done (s)he clicks on the chekout button; when checkout is clicked all the information is to be added to a database with some unique invoice number to identify the sale in future.


regards,
arjun
View profile  Send private message
wkempees


Posts: 1679
Posted: 05/27/2008, 12:10 PM

Arjun,

I did understand what you wanted in the first place from this post as well as from the one titled: bill.

However I pointed you to the example and thought you would be able to go from there.

I would also suggest to look at the 'store' example, it handles the cart and is almost 75% of what you need.
I cannot afford to completely step-by-step explain in casu build it for you as my time is paid for by others.
Try the store example and if that not helps than come back, I am also not a .net guy (yet), so any help[ offered would be general directions.

Walter
(hope your not dissapointed)
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
alpha55

Posts: 14
Posted: 05/27/2008, 12:24 PM

well i've already tried the store example but it didn't work out properly as the information required by me is not available; i know just what to do what would be the process flow but i'm getting stuck

anyway thanx for you replies; i'll try my best to figure out a solution for my problem

regards,
arjun
View profile  Send private message
alpha55

Posts: 14
Posted: 05/27/2008, 9:25 PM

hi walter;

i've devised a work around; now i need to create a dynamic table to add items is it possible using cc4

regards,

arjun
View profile  Send private message
wkempees


Posts: 1679
Posted: 05/28/2008, 5:26 AM

Arjun ,
Not sure what you intend to do.

One work around would be to have a sequence table.
You would get a sequence, and use that as a ordernumber in both order and orderdetail.

But the Multiform example has the complete way to go.

A form on order, AfterInsert event retreive last inserted ID.
Then redirect to the orderdetail grid and use the retreived ID there.

Sorry for short answer but am about.

Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
alpha55

Posts: 14
Posted: 05/28/2008, 7:21 AM

hi walter;

i've worked out the problem; thanks for your support.

regards,
arjun
View profile  Send private message
wkempees


Posts: 1679
Posted: 05/28/2008, 7:59 AM

Your welcome,
Happy Charging
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
mahindra21

Posts: 5
Posted: 06/10/2008, 11:44 PM

hi , i am new in codecharge ,please give mw idea about this codecharge ,like we have pleanty of example here but, i want to know, can we develop our own customised website, with our own database and design.. if possible please reply me...asap


Thanks....O:)
_________________
Software Developer
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.