OleDbCommand.Prepare方法要求所有参数都具有明确设置的密码更改类型

时间:2015-01-20 13:24:55

标签: vb.net passwords

我需要帮助处理涉及我的程序中的密码更改功能代码的问题。每次我尝试更改密码时,我都会收到错误“OleDbCommand.Prepare方法要求所有参数都有明确设置类型”,如果你能帮我解释问题是什么,我将非常感激。这是我的代码:

Dim currentpassword As String

currentpassword = txtCurrentPassword.text

sqlQuery = "SELECT * FROM tblLogin WHERE Code1 = @CurrentPassword"

darunnerlogin = New OleDb.OleDbDataAdapter(sqlQuery, RunnerConnection)
darunnerlogin.SelectCommand.Parameters.AddWithValue("@CurrentPassword", txtCurrentPassword.Text)

darunnerlogin.Fill(dsrunnerlogin, "login")

    RunnerConnection.Close()
If dsrunnerlogin.Tables("Login").Rows.Count = 0 Then
    MsgBox("Please Enter a Correct Password")
Else

    Dim cbRunners As New OleDb.OleDbCommandBuilder(darunnerlogin)

    dsrunnerlogin.Tables("login").Rows(0).Item(2) = txtNewPassword.Text
    darunnerlogin.Update(dsrunnerlogin, "login")
    MsgBox("Password Updated")
End If 

0 个答案:

没有答案