Click here to Skip to main content
15,912,457 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all visitors
i have created 2 tables (SaleHeader,SaleDetail) in sql server 2005.
SaleHeader is the master and SaleDetail is the Detail(show data in datagrid).
in SaleHeader(Shcode,custcode,empcode,discount,amount),SaleDetail(code,Shcode,Itemcode
,qty,discount,Amount)
i created datasource that connect to these tables. then i drop SaleHeaderDatasource to my form as Detail(and it will show all texbox that link to each field in table SaleHeader) and SaleDetail on the form as DataGridView( and it will show all fields that link to each field in table SaleDetail).but in the DataGridView(get from Table SaleDetail), i just want to show ItemCode,ItemName,Qty,Discount,Amount and for code field will automatic created.

How can i show Itemcode,ItemName,Qty,Discount,Amount in DataGridView and can save to Table SaleDetail?

Best Regards,
Posted

1 solution

hey there,

i still not quiet clear about your table,
do you want to bind 2 table to 1 binding source in 1 form?

if that's the case you have 2 option :
1. using 2 binding source for each table
2. join the table first before you put into the adapter, remember the join table have to satisfied the constraint that you have decided in both tables if you want to be able to update the tables. (if you are using SQL you can join the table in view mode)


best regards
- samuel -
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900