tags:

views:

39

answers:

2

OK so I've got 2 tables for this instance, Users{UserID, Name}, Company{CompanyID, UserID, Name, Payrate}

i also have 2 combo boxes, first one is for Users which Displays Name, and the Value is UserID i need the second combobox to get the Names from the Company table, but only showing Companies that are relevant to the selected user. I cant work out how to get it to go...

Any ideas???

A: 

What language? C#, VB.NET ? Is this a web app or Windows app? Do you have associations setup in your datacontext to link Company.UserID (child) back to Users.UserID (parent) ?

Rodney Burton
this sounds like it would be better as a comment to the question instead of an answer :)
James Manning
Yes im using C# WinForm app yes i have that association
Brendan
A: 

if it's asp.net and on .net 4, there's some new support for doing the filtering declaratively

if you can't or don't want to use that, then i'd make sure you're using a linqdatasource to populate and use the Selecting event on the LinqDataSource - in there, you can set e.Result to the specific linq query you want to return (against the company table, i assume), which in your case will include a 'where' for filtering to the UserID (selected value) from the other combobox

James Manning