Hi everybody. How do I load a reader with my database connection being in the web.config file? I want to load a dropdownlist with the reader in the default.aspx page.
Printable View
Hi everybody. How do I load a reader with my database connection being in the web.config file? I want to load a dropdownlist with the reader in the default.aspx page.
What do you mean by a 'reader'? Can you be more precise?
Excuse me. I meant datareader.
Ok. Basically you can use ASP.NET data source controls that minimise the amount of code you would write. The DropDownList is a data-bound control so you should be able to point it to the datasource that you go with. The type of datasource control is up to you. If you have a sql server database I would recommend a SqlDataSource. If you already have some kind of data access layer (sounds like you don't) then you would have more options.