Hello. I'm using your Sqlite Data Provider with C#, and I'm having a bit of trouble inserting BLOB data using Command Parameters. I don't know if it has to do with the BLOB data or not, as I don't use Command Parameters anywhere else.
I have a table created like this:
CREATE TABLE [My_Values] (ID INTEGER PRIMARY KEY NOT NULL, ParentID INT NOT NULL, Name TEXT NOT NULL, Type INT NOT NULL, Data BLOB, Encrypted INT NOT NULL DEFAULT 0
I want to insert a row, so I use this SQL:
INSERT INTO [My_Values] (Name, ParentID, Type, Encrypted, Data) VALUES(@Name, @ParentID, @Type, @Encrypted, @Data)
Then I create the parameters:
cmd.Parameters.Add("@Name", SQLiteType.Text, sValueName.Length).Value = sValueName;
cmd.Parameters.Add( "@ParentID", SQLiteType.Int32, 4 ).Value = (int) nParent;
cmd.Parameters.Add( "@Type", SQLiteType.Int32, 4 ).Value = (int) nType;
cmd.Parameters.Add( "@Encrypted", SQLiteType.Int32, 4 ).Value = 0;
cmd.Parameters.Add( "@Data", SQLiteType.Blob, pData.Length ).Value = vData;
vData is just a byte[] with a length of 4. When I execute the Command, I get the error below. Any idea what I'm doing wrong?
"2nd parameter to sqlite3_bind() out of range
bind or column index out of range"
Thx
-BrettG