Craig_Muckleston
asked on
Retrieving 'Child' Rows
I have a database with a table (tblEmployees) that stores employees details. It is linked to a table called tblDocumentArchive that stores information about employee documents (ie contract, appraisals etc). The information stored are things like document title, create date etc. They are linked as a 1-many relationship by EmployeeNumber.
I have a .NET form that has an OleDbConnector, Adapters as necessary, and a Dataset (dsEmpDocs) that has both the above tables within it. I have created a datagrid (grdEmp) on my form that is populated with employee names at run time. (I use Me.adptEmployees.Fill(dsEm pDocs) to populate the list) All my other fields are populated with the employee details and as I moved through the list of employees, so the data changes in each field - as expected.
However, I have another datagrid (grdEmpDocs) that lists (or should anyway) each document that is 'attached' to the current employee, but when I move through my employees in grdEmp, my list of documents doesn't get refreshed (all the other data does)
How can I get my second grid to refresh with the first? I have been going around in circles trying everything programmatically with examples, or everything graphically with a few lines of code, and I think I have just confused myself as to where I am now.
I have a .NET form that has an OleDbConnector, Adapters as necessary, and a Dataset (dsEmpDocs) that has both the above tables within it. I have created a datagrid (grdEmp) on my form that is populated with employee names at run time. (I use Me.adptEmployees.Fill(dsEm
However, I have another datagrid (grdEmpDocs) that lists (or should anyway) each document that is 'attached' to the current employee, but when I move through my employees in grdEmp, my list of documents doesn't get refreshed (all the other data does)
How can I get my second grid to refresh with the first? I have been going around in circles trying everything programmatically with examples, or everything graphically with a few lines of code, and I think I have just confused myself as to where I am now.
ASKER
Hi Pratap,
Thanks for the info. I'm a little stuck though (I'm new to .NET). I understand everything you say up to "employeeid=" + selectdempid.
Is this the same as saying
dsEmpList.Tables(0).Defaul tView.RowF ilter = "EmployeeNumber" Is _ Me.tboEmpNo.Text
What do I bind the DataGrid to then? (Sorry for sounding naive)
Thanks for the info. I'm a little stuck though (I'm new to .NET). I understand everything you say up to "employeeid=" + selectdempid.
Is this the same as saying
dsEmpList.Tables(0).Defaul
What do I bind the DataGrid to then? (Sorry for sounding naive)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Pratap,
Thanks for all your help, it works a treat.
Cheers
Thanks for all your help, it works a treat.
Cheers
dsEmpDocs.Tables(0).Defaul
That should solve your problem.
Have Fun!
Pratap