This topic is locked

Filtering Data Based on a QueryString

7/18/2007 12:51:07 AM
ASPRunner.NET General questions
P
PhilipM author

Hi
I have just started using ASPRunner.NET. It is a great product. Very easy to use.
I am displaying info from a database. One of the fields is called "DrawingNo". I would like to filter the info displayed based on a query string, e.g. I would like to have a query string "...?DrawingNo=1" and be able to display only the info related to the fields where the drawing no. is 1.
I have tried to change the SQL statement to achieve this without success. Any suggestions how this could be achieved?
Regards
Philip

Eugene 7/19/2007

Use next code:
[codebox]Private Sub BuildDataSource()

...

If Not IsNothing(Request.QueryString("DrawingNo")) Then

Dim DrawingNo As String = Request.QueryString("DrawingNo").ToString()

sSqlWhere = func.WhereBuilder(sSqlWhere, "DrawingNo=@DrawingNo", "And")

OrdersSqlDataSource.SelectParameters.Add("DrawingNo", TypeCode.Int32, DrawingNo)

End If

dbGrid__Table1.DataBind()

...

End Sub[/codebox]