I have a SQL 2000 table named IMSRejects with the fields:
IMSRejects.Prod uctDescription
IMSRejects.Vend orName
IMSRejects.Cata logNumber
IMSRejects.Prod uctIMS2Desc
IMSRejects.CMA8 Desc
Many of the ProductIMS2Desc and CMA8Desc values are Null. I have an ASP.NET
2.0 web page which populates a datagrid with this data. I also have text
boxes on my web page so users can filter the datagrid based on keywords. The
problem I'm having is that the SELECT statement that populates the datagrid
does no handle null values for ProductIMS2Desc and CMA8Desc. Here's the
statement:
Dim _SqlAccounts As String = "Select * FROM IMSRejects WHERE " & _
"IMSRejects.Pro ductDescription LIKE '%" & strProductName & "%' AND "
& _
"IMSRejects.Ven dorName LIKE '%" & strVendorName & "%' AND " & _
"IMSRejects.Cat alogNumber LIKE '%" & strCatalogName & "%' AND " & _
"IMSRejects.Pro ductIMS2Desc LIKE '%" & strFranchiseNam e & "%' AND "
& _
"IMSRejects.CMA 8Desc LIKE '%" & strProductLineN ame & "%' " & _
"ORDER BY VendorName ASC, ProductIMS2Desc ASC, CMA8Desc ASC"
I'd like to default to True a checkbox on my web page named cbShowAll and
add an IF clause that will show all records including those where
ProductIMS2Desc and CMA8Desc contain NULL values. When the checkbox is FALSE,
I'd like the grid to only show records ProductIMS2Desc and CMA8Desc don't
have NULL values.
THANKS!!