views:

43

answers:

1

I am getting this exception from a MySqlCommand.ExecuteNonQuery():

Index and length must refer to a location within the string.

Parameter name: length

The command text is as follows:

INSERT INTO accounts
    (username, password, salt, pin, banned,
    staff, logged_in, points_a, points_b, points_c, birthday)
VALUES
    ('adminb', 'aea785fbcac7f870769d30226ad55b1aab850fb0979ee00481a87bc846744a646a649d30bca5474b59e4292095c74fa47ae6b9b3a856beef332ff873474cc0d3',
    'cb162ef55ff7c58c7cb9f2a580928679', '', '0, '0', '0', '0',
    '0', '0', '2010-04-18')

Sorry for the long string, it is a SHA512 hash. I tried manually adding this data in the table from MySQL GUI tools, and it worked perfectly. I see no "out of range" problem in these strings. Does anybody see something wrong?

+1  A: 

I can't explain the error message, but I can see one thing that is wrong:

'0,

There is a single quote missing. It should be this:

'0',
Mark Byers