How would I go about loading result sets from separate SQL Server Database queries into a GridView?
<p>I have to accomplish what seemed like a pretty trivial task, but it has proven to be a bit more confusing than I anticipated. Here is the scenario: </p>

<p>I have a <code>GridView</code> that is getting data from my <code>SQL Server</code> database and displaying it on a web page (a pretty normal scenario). However, I have some filters that determine which query is run on the database, which obviously determines the data that is ultimately displayed in the <code>GridView</code>. I am having a bit of trouble incorporating these filters efficiently. Currently, I have these three subroutines: <code>LoadPendingRequests()</code>, <code>LoadApprovedRequests()</code>, and <code>LoadDeniedRequests()</code>. As you might expect, I have a <code>CheckboxList</code> that allows the user to choose "Pending," "Approved," or "Denied," and, depending on which is chosen, the corresponding subroutine is called, thus populating the <code>GridView</code> with the corresponding data. This part works.</p>

<p>The user has the option to load any combination of pending, denied, and approved requests at the same time, however. This is where I'm having trouble. Here is the <code>SelectedIndexChanged</code> event handler for the <code>CheckboxList</code>: </p>

<pre><code>Protected Sub CheckboxList1_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles CheckboxList1.SelectedIndexChanged

        If CheckboxList1.SelectedIndex &lt; 0 Then
            CheckboxList1.SelectedIndex = 0
        End If


        If CheckboxList1.Items(0).Selected = True Then 'pending checkbox
            LoadPendingRequests()
        End If
        If CheckboxList1.Items(1).Selected = True Then 'approved checkbox
            LoadApprovedRequests()
        End If
        If CheckboxList1.Items(2).Selected = True Then 'denied checkbox
            LoadDeniedRequests()
        End If
    End Sub
</code></pre>

<p>Here is an example of the subroutines that load the requests (they're all the same, just replace the filter word in the "where" clause): </p>

<pre><code>Protected Sub LoadPendingRequests()
            Try
                Dim DbConnection As New DevConnection()
                Dim Da As New SqlDataAdapter()

                Using DbConnection.Conn
                    DbConnection.Conn.Open()
                    Using SqlCmd As New SqlCommand()
                        With SqlCmd
                            .Connection = DbConnection.Conn
                            .CommandType = CommandType.Text
                            .CommandText = "SELECT * FROM dbo.reqTable where Status = 'Pending'"
                        End With
                        Using Da
                            Da.SelectCommand = SqlCmd
                            Using Dt As New DataTable()
                                Da.Fill(Dt) 'populates the dataset
                                Gv.DataSource = Dt
                                'Gv.DataBind()

                                CheckSuggestionApprovalStatus()
                            End Using
                        End Using
                    End Using
                End Using
            Catch ex As Exception

            End Try

    End Sub
</code></pre>

<p>How would I go about loading pending, approved, and denied requests at the same time when the user clicks on the boxes in the <code>CheckboxList</code>, given this setup? I am open to changing this process entirely if necessary.</p>