Pergunta

I am using vb.net sqlite.net and dblinq0.20.1 to search a sqlite table on a primary key field.

My code looks like this

Dim blb = (From d In db.Data Where d.UID = myuid Select d).Single

This returns the error "Coalesce used with type that cannot be null"

If I search on a nullable field it works fine.

Anyone come across this error before and throw any light on what the issue is?

Foi útil?

Solução

This error message was a bit misleading. The field in question (the primary key for the table) was in fact nullable whereas it should not have been. I changed the field property to 'not null' and the linq query worked as expected.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top