我无法修复代码,它总是显示没有给出一个或多个参数的值。我想知道我应该改变什么来修复它。我的数据库是基于我怀疑的电子邮件地址是问题的根源,因为它包含一个@
字符的查询访问2007删除给定的一个或多个参数没有值
尝试
dataB = "Update login set username = '" & txtUserName.Text.Replace("'", "''") & "' , dateofb = '" & dtpDOB1.Text.Replace("'", "''") & "', placeofb = '" & txtPOB.Text.Replace("'", "''") & "', email = '" & txtEmailID.Text.Replace("'", "''") & "' where userid = " & useridlbl.Text
ConnDB()
cmd = New OleDbCommand(dataB, conn)
Dim i As Integer
i = cmd.ExecuteNonQuery
If i > 0 Then
MsgBox("Update Succesfully", MsgBoxStyle.Information, "Confirmation")
Me.Dispose()
userinfofrm.Show()
Else
MsgBox("Failed Updating", MsgBoxStyle.Information, "Alert!")
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
cmd.Dispose()
conn.Close()
End Try
请问您还可以添加数据库的图表吗? – Dave
Userid --text,username - text,pass - 文本,dateofb - 文本,placeofb - 文本,电子邮件 - 文本 –
如果在调试器中检查dataB的值,是否存在问号或命名参数像文本中的@参数名称? – Markus