troubleshooting Question

Help with entity/VB code to get data from multiple tables and set to string

Avatar of Member_2_1242703
Member_2_1242703 asked on
* Entity Framework CoreVisual Basic.NET.NET ProgrammingASP.NETMicrosoft SQL Server
5 Comments1 Solution74 ViewsLast Modified:
I have 2 tables:

tblTeams (cols are ID, Team, RegionName (this is an int), URL)
tblRegions (cols are ID, RegionName)

I want to write some code that first puts every entry of tblRegions into a list
For each item in that list, I want to find each Team and URL from tblTeams where tblRegions.ID = tblTeams.RegionName and add the values to a string.

I have a model setup with the 2 tables and need to do this in VB.NET/Entity. I've gotten so far as to get the first part in a list and cycle through it, but I think I may be overcomplicated things. To help understand, I'm trying to make a dropdown navigation menu where the tblRegions.RegionName are the first level, and the tblTeams data are the submenu where the aforementioned where clause is met.

Honestly if I could just have a string that looked something like...

Region1 TeamR1a R1aURL TeamR1b R1bURL TeamR1c R1cURL Region2 TeamR2a R2aURL TeamR2b R2bURL Region3 TeamR3a R3aURL

That would actually work for me.

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros