Click here to Skip to main content
Sign Up to vote bad
good
See more: C#
Hi
please need help on inserting values into two diferent table by the click of a button,
Posted 1 Oct '12 - 22:29

Comments
Sm.Abdullah - 2 Oct '12 - 4:33
where you stuck ?
Mario Majčica - 2 Oct '12 - 4:33
What did you tried till now? With what part of the code do you have problem?
Sandeep Mewara - 2 Oct '12 - 4:37
Share what you tried and where are you stuck.
Stephen Hewison - 2 Oct '12 - 11:32
Insert into one table, repeat for second table.

2 solutions

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  
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
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 8,376
1 OriginalGriff 6,571
2 CPallini 3,533
3 Rohan Leuva 2,703
4 Maciej Los 2,234


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