Mike Ellison has written a neat ASP.NET Query Control. Seems like it could be a quick way to crank out query forms.

<aq:Query runat="server" connection="SqlCon" requeryOnPostback="false"
                         queryType="Text"
                         enabled="true" >


    <sql>
        Select CustomerID, OrderDate, Field3, Field4, ColorCode
          From MyTable 
        Where OrderDate > @orderDate
          And CustomerID = @id
    </sql>


    <parameter name="@orderDate" valueFrom="GET" valueFromId="orderDate" />
    <parameter name="@id" valueFrom="Control" valueFromId="txtCustomerID" 
                          valueFromProperty="Text"/>
    
    <outputTo target="myDataGrid">


    <outputFieldTo target="txtField3" field="Field3" />
    <outputFieldTo target="lblOrderDate" 
                   field="OrderDate" format="dd mmm yyyy" />
    <outputFieldTo target="lblOrderDate"
                   field="ColorCode"
                   outputProperty="BackColor" />


</aq:Query>

TTFN - Kent