This question is locked. New answers and comments are not allowed.
I'm using this LINQ to check if input is valid
Kansalaisuuskoodis.Any(k => k.Kansalaisuuskoodi == input)
This call will fail if the length of input string is not exactly 3 characters:
Telerik.OpenAccess.Exceptions.DataStoreException: Count(*) query failed: Telerik.OpenAccess.RT.sql.SQLException: arithmetic exception, numeric overflow, or string truncation
string right truncation
at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery(Nullable`1 commandTimeout)
at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery(Nullable`1 commandTimeout)
at OpenAccessRuntime.Relational.RelationalStorageManager.executeCount(RelationalCompiledQuery cq, QueryParameters parameters)
SELECT COUNT(1) FROM ( SELECT a."Kansalaisuuskoodi" AS COL1, a."Kayttotiedot" AS COL2, a."LUONTIAIKA" AS COL3, a."MUUTOSAIKA" AS COL4, a."Maa" AS COL5 FROM "Kansalaisuus" a WHERE a."Kansalaisuuskoodi" = ? ) AS TMP_COUNT
This seems odd to me, since Firebird sql is working as expcted with such a query (comparing char(3) column with a varchar(5) input).
So currently I compare the lenght of the input before checking the database, but this seems like something should not be needed.
Any idea what could cause this exception?