Binding a dropdownlsit to a button to determine datagrid rows
I am using ASP (not ASP.net) and SQL ServerI have a datagrid that I want filtered data to appear in. To do that, I created a dropdownlist which is populated from the same table as the datagrid, however now I'm stuck on how to update the datagrid with the selection that's been made in the dropdownlist. I'd like to use a button. Can anyone help me with this?Here's my existing code:<%ConnString = "DSN=LocalUpload;"Set conn = Server.CreateObject("ADODB.Connection")conn.Open("Provider=SQLOLEDB.1;Password=helpdesk;Persist Security Info=True;User ID=HelpDesk;Initial Catalog=HelpDesk;Data Source=s9DCA3E") Set rs = SERVER.CreateObject("ADODB.Recordset")' first have to get the Department records to fill the drop down....' Set SQL statementstrSQL = "SELECT * From Departments WHERE DepartmentID > 0 ORDER BY DepartmentName ASC"' Open Recordset Objectrs.Open strSQL,conn, adOpenStatic%>
Select A Department:<% Do While Not rs.EOFResponse.Write (" " & rs("DepartmentName"))rs.MoveNextLooprs.CloseSet rs=Nothing%> !<% If Request.QueryString("qryDepartment") = "" ThenResponse.Write("Please select a Department from the list.")Else' Build querySet rs = SERVER.CreateObject("ADODB.Recordset")' first have to get the Department records to fill the drop down....' Set SQL statementstrSQL = "Select a.ProblemStatusId,b.TeamMemberName,c.problemTitle,e.DepartmentName,a.ProblemStatus From(((ProblemsUsersDeptsReps d Inner Join Departments e on d.DepartmentID = e.DepartmentID) Inner Join Problems c on d.ProblemID = c.ProblemID) Inner Join ProblemStatus a on d.ProblemsUsersDeptsRepsID = a.ProblemsUsersDeptsRepsID) Inner Join TeamMembers b on a.TeamMemberId = b.TeamMemberId Where (UPPER(a.ProblemStatus) = 'OPEN') and (e.DepartmentName = 'strsql') ORDER BY e.DepartmentName" Request.QueryString("qryDepartment") & "'))"' Open Recordset Objectrs.Open strSQL,conn,adOpenStaticIf rs.RecordCount = 0 ThenResponse.Write("No records found for Department " & Request.QueryString("qryDepartment"))ElseResponse.Write(" Items Found for Department: " & Request.QueryString("qryDepartment") & " ")' Build a table hereResponse.Write("