Hi, I have an aspx form that is meant to add a new prescription for a doctor system. I've created the database and dataset needed, but the problem is that the doctorID and patientID has to be able to select from the database, not entered in as a plain text. The form look something like this (I did this in DetailsView in MS Visual Studio 2010):

DoctorID: [textbox]

PatientID: [textbox]

prescription details: [textbox]

Insert Cancel

as you can see, only the prescription details needed to be entered in and the doctorID and patientID needed to be selected from the database (in a dropdown list maybe) and it shouldnt allow any text to be entered in. I did the above tables using a DetailsView in Microsoft Visual Studio 2010. However I can't seem to make the doctor and patient ID field be dropdown box which allow me to choose the current doctor and patient in the Doctor and Patient table in the databse. Can anyone tell me how to do it with Design View in Visual Studio? Cause the source view is kinda confusing for me.

Thanks in advance!

8 Years
Discussion Span
Last Post by Izzy123

try this:

1) drag a drop down list control to ur form
2) click on the arrow on it(top right corner) then click "choose data sources"
3) under select data source click "new data source"
4) then click on database(if using sql server) click access database for ms access
5) you shud be able to select ur current DB's connection string from the ddlist; click next
6)under "specify coloumns froma table..." select the table under which the DoctorID is
7) DoctorID and other columns shud appear select only the DoctorID column
8) click next and u shud be good to go.


Hi, thanks for the reply. I fixed the error by dragging a formView, then choose the edit template to add a dropdown list.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.