p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 28th, 2009, 02:06 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default update one table column from another table column

hi
i have two table
StudentAccountTable and billmonthly
studentaccounttable contain

Student Id Namefield Class Roll BalanceAmount
1001 abc 2 3 2500.00
1002 Dbc 3 3 3500.00
here studentid is primary key

in billmonthly


StudentID Total amount
1001 100
1002 1500
Here StudentId Also Primary Key
now i wann update studentaccounttable (BalanceAmount) at once from Billmonthly (TotalAmount) for this i make query on sql

UPDATE StudentAccountTable
SET BalanceAmount = StudentAccountTable.BalanceAmount+billMonthly.Tota l
FROM StudentAccountTable, billMonthly
WHERE StudentAccountTable.StudentId = billMonthly.StudentId

which work very well
now i want this code work through code
Please help me to do this through code

Thanks in Advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old February 28th, 2009, 04:46 AM
Registered User
Points: 36, Level: 1
Points: 36, Level: 1 Points: 36, Level: 1 Points: 36, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2009
Posts: 8
Thanks: 0
Thanked 1 Time in 1 Post
Default

hi

you can use below query

UPDATE TEMP1 SET ID = (SELECT ID FROM TEMP2 WHERE NAME = TEMP1.NAME )

here TEMP1 and TEMP2 tables have common filed called Name.

It will work fine
__________________
Rajendar
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
update table column from another table elygp SQL Language 6 December 29th, 2008 02:23 AM
auto update from 1 table to column in another tabl headwaters Access 1 December 1st, 2008 08:39 AM
Generating a 3 Column Table garethdown44 XSLT 4 June 14th, 2005 02:22 PM
How can I update 2 rows in one column in SQL table babou Classic ASP Databases 6 March 9th, 2005 11:13 AM
how to make column of table 1 = to column of table gilgalbiblewheel Classic ASP Databases 4 October 12th, 2004 12:57 AM



All times are GMT -4. The time now is 11:40 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc