Reputation: 20120
if I run this under c#
from p in Addresses where p.Address2 == null select p.AddressID
it generate this query
SELECT [t0].[AddressID]
FROM [dbo].[Address] AS [t0]
WHERE [t0].[Address2] IS NULL
if I run this under vb.net
from p in Addresses where p.Address2 = nothing select p.AddressID
it generate this query
SELECT [t0].[AddressID]
FROM [dbo].[Address] AS [t0]
WHERE [t0].[Address2] = ''
p.Address2 is a varchar field that accept null value
why vb.net is "wrong" ?
Upvotes: 3
Views: 91
Reputation: 16086
in VB, null checks are controlled with "is" keyword.
try this;
from p in Addresses where p.Address2 is nothing select p.AddressID
Upvotes: 8