Hi,
I created a table with a CHAR column in it, like this:
CREATE TABLE ClientData(...., Status CHAR(1) NULL, ...)
When inserting data i use a parameter with DbType.Byte.
But when I read the data using a DataReader (SQLiteDataReader) and try the following code
char x = dataReader.GetChar(10);
i get:
Specified cast is not valid.
at System.Data.SQLite.SQLiteDataReader.VerifyType(Int32 i, DbType typ)
at System.Data.SQLite.SQLiteDataReader.GetChar(Int32 i)
I tried debugging this and I see that in the reader the column has an SQLiteType with Type=String and Affinity=Null and it is the Affinity=Null that is causing the exception.
Can you tell me where i went wrong ?
Thanks in advance.