当我使用参数时,我一直被告知我的 mysql 语法中有错误。
这是我的代码:
Dim db As New Database
Dim sql As String = "select firstname, password from users where email = :email"
Dim args As New List(Of MySqlParameter)
args.Add(New MySqlParameter(":email", txtEmail.Text))
' execDB(procedurename As String, proceduretype As String, parameters() as MySqlParameter, returntype As String, newconnection As Boolean)
Dim dr As MySqlDataReader = db.execDB(sql, "Text", args.ToArray, "DataReader", False)
错误表明这:email
不是有效值。我不明白为什么它不使用参数,因为我将它传递给execDB
函数。
在此先感谢您的帮助。