R
rew190
Hi guys, I've been struggling with this one for a while.
I have a typed dataset. It has two tables inside of it; Resources and
EmployeeMaster. Both EmployeeMaster and Resources have a column called
"EmpID", an int, which is also both of their primary keys. This is the
relationship between the two, and is present in the dataset.
EmployeeMaster has detailed data about employees such as full name,
address, email, etc. Resources is a table that I created that is used
to determine which employees are using a program I am writing right
now, and what their security level is. That column is of type int
called "UserType".
So this is all set up, my dataset is populating nicely with every row
from both tables, everything seems to be set.
Now, what I want to do is populate a listbox on a C# Windows.Forms app
with employee names (stored only in EmployeeMaster) of only those
employees who have a UserType (stored only in Resources) of 5.
The equivalent SQL for this is simple. "SELECT emp.LastName FROM
EmployeeMaster emp, Resources r WHERE r.UserType = 5"
I can't figure out how to get the equivalent of this to work in my
typed DataSet so I can databind it to my listbox. I looked at
DataViews, but couldn't find any decent examples of the RowFilter that
was filtering on a child table. I did find one page that said there's
a "[child]" keyword that should be put in there, but I couldn't figure
that out. I also looked at DataViewManagers, but hit a dead end on
that one as well.
Can one of you gurus give me a little guidance, please? I feel silly
asking what's probably a really simple question, but I've scoured the
net for hours and haven't found anything.
Thank you VERY much to any and all help!
Andy K
I have a typed dataset. It has two tables inside of it; Resources and
EmployeeMaster. Both EmployeeMaster and Resources have a column called
"EmpID", an int, which is also both of their primary keys. This is the
relationship between the two, and is present in the dataset.
EmployeeMaster has detailed data about employees such as full name,
address, email, etc. Resources is a table that I created that is used
to determine which employees are using a program I am writing right
now, and what their security level is. That column is of type int
called "UserType".
So this is all set up, my dataset is populating nicely with every row
from both tables, everything seems to be set.
Now, what I want to do is populate a listbox on a C# Windows.Forms app
with employee names (stored only in EmployeeMaster) of only those
employees who have a UserType (stored only in Resources) of 5.
The equivalent SQL for this is simple. "SELECT emp.LastName FROM
EmployeeMaster emp, Resources r WHERE r.UserType = 5"
I can't figure out how to get the equivalent of this to work in my
typed DataSet so I can databind it to my listbox. I looked at
DataViews, but couldn't find any decent examples of the RowFilter that
was filtering on a child table. I did find one page that said there's
a "[child]" keyword that should be put in there, but I couldn't figure
that out. I also looked at DataViewManagers, but hit a dead end on
that one as well.
Can one of you gurus give me a little guidance, please? I feel silly
asking what's probably a really simple question, but I've scoured the
net for hours and haven't found anything.
Thank you VERY much to any and all help!
Andy K