gpt4 book ai didi

mysql - 列计数与第 1 行的值计数不匹配

转载 作者:行者123 更新时间:2023-11-29 23:40:02 25 4
gpt4 key购买 nike

我花了太多时间来解决这个错误,并且无法在此处找到错误

Adapter = New MySqlDataAdapter("Insert into tbluser(UserID,Name,UserType,Password) values('" & txtUserId.Text & "' ,'" & txtName.Text & "','" & cmbUserType.Text & "','" & "',AES_ENCRYPT('" & txtpass.Text & "','x'))", connection)

最佳答案

Adapter = New MySqlDataAdapter("Insert into tbluser (UserID
,Name
,UserType
,Password)
values( '" & txtUserId.Text & "'
, '" & txtName.Text & "'
, '" & cmbUserType.Text & "'
, '" & "'
, AES_ENCRYPT('" & txtpass.Text & "','x'))", connection)

您的值多于定义的要插入的列。看起来问题是用户类型和密码之间的空字段。像这样修改它应该可以解决列计数错误:

Adapter = New MySqlDataAdapter("Insert into tbluser ( UserID
, Name
, UserType
, Password)
values( '" & txtUserId.Text & "'
, '" & txtName.Text & "'
, '" & cmbUserType.Text & "'
, AES_ENCRYPT('" & txtpass.Text & "','x'))"
, connection)

关于mysql - 列计数与第 1 行的值计数不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26204311/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com