Click here to Skip to main content
13,350,861 members (54,726 online)
Rate this:
Please Sign up or sign in to vote.
See more:
please need help on inserting values into two diferent table by the click of a button,
Posted 1-Oct-12 23:29pm
Sm.Abdullah 2-Oct-12 4:33am
where you stuck ?
Mario Majčica 2-Oct-12 4:33am
What did you tried till now? With what part of the code do you have problem?
Sandeep Mewara 2-Oct-12 4:37am
Share what you tried and where are you stuck.
Stephen Hewison 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
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.180111.1 | Last Updated 2 Oct 2012
Copyright © CodeProject, 1999-2018
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