4
Contributors
5
Replies
7
Views
6 Years
Discussion Span
Last Post by adam_k
0

Create a view that contains the two table then u can check the fields u want to display. then bind the new view to a form .

0

Or query the db using a join. What are you building?
With some more info, we might be more helpful

0

Iam doing a project in Visual studio 2008, I connected database from MS SQL Server 2005 to Visual studio 2008. In my SQL I've created two tables, Student Information Table and the Payment Table. In my Student Information table I have the following fields: Student Number, Name, Year Level and Section... while in my Payment table I have Student Number, Downpayment, Balance fields... What I want to do is when I click a button 'SAVE' it will save in the database then whenever I want to view the Payment Records of Student it will display the Student Number, Name, Downpayment and Balance in combined in one table in a form... How can I do that? Can you provide me some codes? or any explanation about it? thanks.. :)

0

Your query would be:

select a.StudentNumber, Name,DownPayment,Balance from StudentInformation a inner join Payment b on a.StudentNumber = b.StudentNumber 
where StudentNumber = '1234'

But I am not sure that the structure you are following will work out for you.
What are you storing in downpayment? Only the last payment? How will you keep track of all the payments (if this is the table, you might want to also record payment date and payment method). Also Balance is not something we would record with payments, as it needs to be updated with the Credit as well as with the Debit.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.