Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
Hi
please need help on inserting values into two diferent table by the click of a button,
Posted 1-Oct-12 23:29pm
Comments
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
good
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.
  Permalink  
Rate this: bad
good
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.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 6,434
1 OriginalGriff 6,178
2 Peter Leow 2,534
3 Abhinav S 2,274
4 Maciej Los 2,268


Advertise | Privacy | Mobile
Web02 | 2.8.150414.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