开发者

ArgumentOutOfRangeException at MySql execution. (MySqlConnector .NET)

开发者 https://www.devze.com 2022-12-27 20:40 出处:网络
I am getting this exception from a MySqlCommand.ExecuteNonQuery(): Index and length must refer to a location within the string.

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?


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',
0

精彩评论

暂无评论...
验证码 换一张
取 消