Hi Experts,
I am using the below code to see if there is a value in the paramter collection and if there is a value it will execute the next line sql.However, if the users leave the text box empty then i do not have a value in the paramter collection and i do not want to execute the next line of sql statemnt.I do not know how to do this can someone help.thanks a bunch
If Not txtVendorName.Text = "" Then
Sql = Sql & " AND (Upper(V.VNAMEL) LIKE '%' || Trim(Upper
VendorName))|| '%') "
End If
Sql = Sql & " AND V.VOBSOLET = 'N' "
Sql = Sql & "GROUP BY V.VENDOR, R.ADDRNUM,V.VNAMEL,R.AADDR1,R.AADDR2,R.ACITY,R.ASTATE, R.AZIPCODE, R.APHONE, R.VASST1, P.DATEPUR "
Sql = Sql & "ORDER BY V.VENDOR "
Response.Write("Sql " & "<br/>" & Sql & "<hr/>")
SqlDataSource1.SelectCommand = Sql
I am using the below code to see if there is a value in the paramter collection and if there is a value it will execute the next line sql.However, if the users leave the text box empty then i do not have a value in the paramter collection and i do not want to execute the next line of sql statemnt.I do not know how to do this can someone help.thanks a bunch
If Not txtVendorName.Text = "" Then
Sql = Sql & " AND (Upper(V.VNAMEL) LIKE '%' || Trim(Upper

End If
Sql = Sql & " AND V.VOBSOLET = 'N' "
Sql = Sql & "GROUP BY V.VENDOR, R.ADDRNUM,V.VNAMEL,R.AADDR1,R.AADDR2,R.ACITY,R.ASTATE, R.AZIPCODE, R.APHONE, R.VASST1, P.DATEPUR "
Sql = Sql & "ORDER BY V.VENDOR "
Response.Write("Sql " & "<br/>" & Sql & "<hr/>")
SqlDataSource1.SelectCommand = Sql