Selecting All from Dropdowlist
Hello Eveybody:
I am having problems to display a dropdownlist control into a DataGrid. The problem is that when I select "All" from the dropdownlist my Gridview is empty. However for any other values is working fine. As you will see in the code "All" means All the records"
Dim sqlqry AsString
Dim dropdownvalue AsString
dropdownvalue = DropDownList1.SelectedValue
Dim comp AsInteger = String.Compare(dropdownvalue, "ALL")
'dropdownvalue = "ALL"
If comp = 0 Then
sqlqry = "select * from CompletedOrders"
Me.SqlDataSource2.SelectCommand = sqlqry
Else
sqlqry = "select * from CompletedOrders where Week#=@Week#"
Me.SqlDataSource2.SelectCommand = sqlqry
'Dim pm As New Parameter("CompletedOrders", TypeCode.Int32, 1)
'Me.SqlDataSource2.SelectParameters.Add(pm)
EndIf
Thank you. Let me know what is missing Here
|