Home:ALL Converter>Populate DropDownList from database column, use DropDownList values to populate a table?

Populate DropDownList from database column, use DropDownList values to populate a table?

Ask Time:2012-11-10T02:55:09         Author:user1077685

Json Formatter

I just started working with ASP.NET and Visual Studio 2008. I want to create something fairly straightforward, yet I don't know how to approach it yet.

I have access to an Oracle table that I'd like to leverage to create a report interface. For simplicity's sake, let's assume that this table only has three columns:

  1. REPORT_DATE
  2. SUCCESSES
  3. FAILURES

Now, the proposed ASP.NET interface will only have two components:

  1. DropDownList
  2. GridView (or table, whichever is simpler)

The DropDownList will allow the user to select a date (e.g. 11/8/2012). The GridView will then populate based on the user selection. It will display all columns except "REPORT_DATE". In this hypothetical scenario, the GridView will display "SUCCESSES" and "FAILURES". Essentially, it would follow this SQL statement:

SELECT * FROM MyTable WHERE REPORT_DATE=insertSelectedReportDateHere;

So far, I have successfully populated the DropDownList with REPORT_DATE using Visual Studio's GUI to connect to my database and table. However, I'm unsure how to implement the population of the GridView based on my selection. I assume this will require hard-coding AJAX, but I wasn't sure how powerful Visual Studio's GUI was.

Is there a way to do this using the GUI? Or do I have to do it programmatically? Any suggestions or resources that I should reference?

Thank you!

Author:user1077685,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/13314194/populate-dropdownlist-from-database-column-use-dropdownlist-values-to-populate
yy