CommunityHiQ/Frends.Community.Postgre

Parameter can't be NULL

Closed this issue · 3 comments

It is possible to pass NULL to query if it is written straight in to query, but if it is passed through parameter it doesn't work.

Maybe a empty string could indicate that parameter is NULL? Atm empty string gives compile time time warning "Parameter 'PARAM' must have its value set". "Parameter 'PARAM' must have its value set", so that would not break anything. Or just convert string "NULL" to NULL.

NULL can be passed by setting the parameter to DBNull.Value

Maybe the task should convert null to DBNull.Value automatically.

Empty string must not be passed as null, because they are not equal.

Yeah, C# null to DBNull.Value conversion sounds best to me

Fixed issue by creating parameter.Value check and converting it to DBNull.Value if null. #7