I suppose you could do it two ways.
1) You can write a single SQL query which will return something like:
CONTACT NAME | PHONE NUMBER
-----------------------------------
JOHN | 555-555-5551
JOHN | 555-555-5552
JANE | 555-555-5553
And then your business logic can parse the results into the correct DataSet
, DataTable
, Enumerable
, or whatever you're binding to your GridView
.
2) You can write one SQL query to get all contacts, bind that to your GridView
, loop through all the contacts, individually query for that contact's phone numbers, and then bind those results to the drop down contained within the record for that contact.
I prefer the first, but either should be OK.