Hi,
I am trying to do a SQL query to see if an Address already exists in my database. My addresses are structure like this:
line1
line2
line3
city
state
zipcode
country
Sometimes line2 and line3 are NULL values in my database.
I am using .NET TableAdapter and DataTable to make my query. When I try to pass in my line2 parameter (@line2) it is equal to a string with value = nothing. My database does not interpret this as NULL and says the records don't match, but I know they do?
How do I pass in a string = nothing and have it compare to a NULL value in the database as being equal?
I have tried string = DBNULL.value but won't compile. I have done similar comparisons with integers etc. using integer = Nullable(of integer) but this does not exist for strings.
Thanks.