Click here to Skip to main content
11,578,524 members (59,313 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C#
please need help on inserting values into two diferent table by the click of a button,
Posted 1-Oct-12 22:29pm
Sm.Abdullah at 2-Oct-12 4:33am
where you stuck ?
Mario Majčica at 2-Oct-12 4:33am
What did you tried till now? With what part of the code do you have problem?
Sandeep Mewara at 2-Oct-12 4:37am
Share what you tried and where are you stuck.
Stephen Hewison at 2-Oct-12 11:32am
Insert into one table, repeat for second table.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Well, if the two tables that you are inserting to don't have relationships then executing a simple query would suffice.

like string strInsertQuery=@"Insert into table1 Values(value1,value2,value3);Insert into table2 Values(value4,value5,value6)";

Then, execute the query. But, your question is not clear. Please, elaborate and give us some sample codes.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

You may create two method for two individual query operation. Then call that two method into the mehtod which is created for button(Under button operation).

Try this. If not work then provide your full code,i'll try to solve your problem.Anyway best of luck.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Peter Leow 135
1 OriginalGriff 113
2 Richard MacCutchan 85
3 Afzaal Ahmad Zeeshan 75
4 Frankie-C 75
0 OriginalGriff 933
1 Sergey Alexandrovich Kryukov 740
2 Abhinav S 573
3 F-ES Sitecore 420
4 Suvendu Shekhar Giri 403

Advertise | Privacy | Mobile
Web03 | 2.8.150603.1 | Last Updated 2 Oct 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100