[sqlite] Reader.GetBytes() - when is a byte not a byte?

2015-07-04 Thread William Drago
Jean, Thanks for the reply. I understand this very well, and I have read this page many times over the past few years: http://www.sqlite.org/datatype3.html My argument is that regardless of a column's type or type affinity, a method called ReadBytes() should read the bytes as stored in the

[sqlite] Reader.GetBytes() - when is a byte not a byte?

2015-07-03 Thread Jean Chevalier
In SQLite, every value you store is stored alongside its type. This is unlike other databases where the column determines the type and every value stored against it share it. In SQLite you could have a table in which all value types as stored contradict all column types as declared, if you so

[sqlite] Reader.GetBytes() - when is a byte not a byte?

2015-07-02 Thread Drago, William @ CSG - NARDA-MITEQ
ounces at mailinglists.sqlite.org [mailto:sqlite- > users-bounces at mailinglists.sqlite.org] On Behalf Of Jean Chevalier > Sent: Thursday, July 02, 2015 1:40 PM > To: sqlite-users at mailinglists.sqlite.org > Subject: Re: [sqlite] Reader.GetBytes() - when is a byte not a byte? >

[sqlite] Reader.GetBytes() - when is a byte not a byte?

2015-07-02 Thread Jean Chevalier
It's not mandatory to use x'' notation to insert into a blob, when one can use cast. The following should return blob content correctly without explicitly lying it down as Hex: sqlite> create table T (c blob check(typeof(c) = 'blob')); sqlite> insert into T values ( cast('x y z' as blob) );

[sqlite] Reader.GetBytes() - when is a byte not a byte?

2015-07-02 Thread R.Smith
On 2015-07-02 03:24 PM, R.Smith wrote: > That exception is only thrown if the source column is not a BLOB (as > far as I can tell). > > You specify the column Type (or type affinity) as BLOB but then you > store a non-BLOB TEXT value in it ('"blue" "red" "orange" "yellow"' > <-- Not a BLOB) >

[sqlite] Reader.GetBytes() - when is a byte not a byte?

2015-07-02 Thread R.Smith
That exception is only thrown if the source column is not a BLOB (as far as I can tell). You specify the column Type (or type affinity) as BLOB but then you store a non-BLOB TEXT value in it ('"blue" "red" "orange" "yellow"' <-- Not a BLOB) SQLite will store this as TEXT, not BLOB. A BLOB

[sqlite] Reader.GetBytes() - when is a byte not a byte?

2015-07-02 Thread Jean Chevalier
Please provide your code context, as in, http://stackoverflow.com/questions/10746237/sqlite-in-c-sharp-throws-invalidcastexception-using-getbytes Today, Bill wrote: > > All, > Below is a .dump of the database I'm working with. I can use > GetBytes() successfully on all the BLOB columns except >

[sqlite] Reader.GetBytes() - when is a byte not a byte?

2015-07-02 Thread Simon Slavin
On 2 Jul 2015, at 12:47pm, William Drago wrote: > Below is a .dump of the database I'm working with. I can use GetBytes() > successfully on all the BLOB columns except myTextArray. On that column I get > a System.InvalidCastException error. Can anyone tell me why? Thanks. SQLite has no

[sqlite] Reader.GetBytes() - when is a byte not a byte?

2015-07-02 Thread William Drago
All, Below is a .dump of the database I'm working with. I can use GetBytes() successfully on all the BLOB columns except myTextArray. On that column I get a System.InvalidCastException error. Can anyone tell me why? Thanks. -Bill ---.dump file--- PRAGMA foreign_keys=OFF; BEGIN