Lookup two tables
I am brand new to the world of ASP.NET programming and would appreciate any help/pointers on the following:
I have an SQL table that lists all of the medical appointments made so far. This table lists the patient name, the attending doctor, and date+time of the appointment.
I also have a lookup table that lists all of the doctors with their names, and IDs.
What I am aiming to do is on the front end web form, when someone is typing a doctor's name, I first want to look at the appointments table and the auto-complete will then give them a list of all available options. If there isn't a name that matches what the user has begun to type, then it should query the lookup table and give them the available options.
I have gotten the auto-complete for the first stage done, but not for the second. How do I go about doing this?
P.S.: I am using Visual Studio 2008 and SQL Server 2008.