User240536124 posted
OK. I haven't had to ask for help in quite some time on here, but I'm stuck. ASP.net with a SQLDATASOURCE and an MS Access Database as the db.
This works fine: SelectCommand="SELECT * FROM [xipam_192_168_0_x] WHERE COL2 <> Null"
This does not: SelectCommand="SELECT * FROM [xipam_192_168_0_x] WHERE COL2 = Null"
The Gridview I'm binding pulls up nothing. I have tried 20 different variations of matching a null and I get no data returned in any of them.
I have tried this in the sqldatasource, as well: <asp:AccessDataSource ID="SqlDataSource3"
CancelSelectOnNullParameter="False" runat="server"
And I have tried 14 different variations of this as a parameter (for example, WHERE COL2 = @COL2):
<asp:SessionParameter DefaultValue=""
Name="COL2" SessionField="COL2"
Type="String" DefaultValue="" />
My thought is that setting the DefaultValue to a null string and then having CancelSelectOnNull = False should work. I must be missing something.
I have tried all kinds of variations in the select statement as well, such as ....OR IS NULL. Just getting nada back every time.
This is one of the last things I need on this page, so any help would be greatly appreciated.
Thanks