Hi can anyone give a sample code to fulfill my expect result:
Lets have an example database having two tables named: tblcustomer and tblorder
relationship field between two tables are custid
fields in tblcustomer: cstid, name, city
fields in tblorder: odr_no, cstid, date,prdid,qty
Using dataset/datatable, i need to display selected customer details from tblcustomer and his order details in gridview
my code is:
cmd = New MySqlCommand("select * from tblcustomer; select * from tblorder;", con)
adp = New MySqlDataAdapter(cmd)
adp.Fill(dset)
Note: i have taken all records from both table. Now i want to show only selected customer details and his order details in gridview.
// how to do this ?
following code will display all records:
GridView1.DataSource = dset.Tables(0)
GridView1.DataBind()
GridView2.DataSource = dset.Tables(1)
GridView2.DataBind()