This question is locked. New answers and comments are not allowed.
I have been using your OpenAccess for a little bit and so far every problem I have had was due to misuse so....here is another one!
I have tow tables Customers and Address. Obviously the address table stores address for the customers. The Customer table as AutoInt ID called "id" which I store in the Address table as "CustID"...this allows the customer to have more than one address(shipping, billing, etc...) I have both tables in the Entity and I can pull data from either one. Now I want to bring up all the customers that have a specific Zip Code which is a field in the Address table\class. I created an association between the tables so that Customers has a Navigation Property "Addresses" which is a ilist of Address. Like I said I am new to this but how can I query the zip code of address and bring up the associated customers. They are tied by the CustID. I should also note that I am utilizing the Dynamic Ling Class for VB.NET. So what I am doing is creating a string with my query and then using that. My program allows the user to add up to five search terms and also choose the field theya re searching on! Works great when I stay inside the customer table but now I need to move outside it!
I will Include some Code Snippets of what I am doing....plus this all may lead to a really dumb followup question! :)
search = "Addresses.Contains(New Address With {.Zip = """ & FirstSearchItem.SearchTermText & """})"
SearchResults = New ObservableCollection(Of Customer)(_mgrCustomer.Customers.Where(search))
Thanks for any help!
I have tow tables Customers and Address. Obviously the address table stores address for the customers. The Customer table as AutoInt ID called "id" which I store in the Address table as "CustID"...this allows the customer to have more than one address(shipping, billing, etc...) I have both tables in the Entity and I can pull data from either one. Now I want to bring up all the customers that have a specific Zip Code which is a field in the Address table\class. I created an association between the tables so that Customers has a Navigation Property "Addresses" which is a ilist of Address. Like I said I am new to this but how can I query the zip code of address and bring up the associated customers. They are tied by the CustID. I should also note that I am utilizing the Dynamic Ling Class for VB.NET. So what I am doing is creating a string with my query and then using that. My program allows the user to add up to five search terms and also choose the field theya re searching on! Works great when I stay inside the customer table but now I need to move outside it!
I will Include some Code Snippets of what I am doing....plus this all may lead to a really dumb followup question! :)
search = "Addresses.Contains(New Address With {.Zip = """ & FirstSearchItem.SearchTermText & """})"
SearchResults = New ObservableCollection(Of Customer)(_mgrCustomer.Customers.Where(search))
Thanks for any help!