This is the Code in C#:

            SQLiteDataReader rdr;
            SQLiteCommand contentCommand;
            String cmd = String.Format("SELECT
filename,content,filesize FROM documents WHERE did={0}",did);

            contentCommand = sqlconn.CreateCommand();
            contentCommand.CommandText = cmd;
            rdr = contentCommand.ExecuteReader();
            rdr.Read();
            MessageBox.Show(rdr.GetFieldType(1).ToString());
            MessageBox.Show(rdr.FieldCount.ToString());

-->        long len = rdr.GetBytes(1, 0, null, 0, 0);
            Byte[] buf = new Byte[len];
            rdr.GetBytes(1, 0, buf, 0,(int) len);

I get the Exception there!  sqlite Exception
System.InvalidCastException: Specified cast is not valid.

The GetFieldType Shows: Systes.Byte[]

What is it that I'm doing wrong?
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to