Last post Mar 07, 2018 08:19 PM by jay8anks
Mar 07, 2018 06:05 PM|jay8anks|LINK
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"
And I have tried 14 different variations of this as a parameter (for example, WHERE COL2 = @COL2):
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.
Mar 07, 2018 08:19 PM|jay8anks|LINK
Well, I swear I tried this multiple times, but I tried it one more time and it worked the first try:
"SELECT * FROM [xipam_192_168_0_x] WHERE WHERE COL2 IS Null"