错误 - 条件表达式中的数据类型不匹配

时间:2016-05-05 10:08:49

标签: vb.net

  ds.Clear()
        connString = provider & datafile
        con.ConnectionString = connString
        con.Open()
        sqlstatement = "SELECT * FROM CustomerInfo WHERE ID = '" & UserbeingEdited & "'"
        ds.Clear()
        da = New OleDb.OleDbDataAdapter(sqlstatement, con)
        da.Fill(ds, "EDITING")
        con.Close()
        Dim recordCount, x As Short
        recordCount = 0
        x = 0
        recordCount = ds.Tables("EDITING").Rows.Count

我在编辑数据库中的用户时遇到问题。这是EditUser表单加载时的代码。发生错误。请帮忙!

1 个答案:

答案 0 :(得分:0)

 sqlstatement = "SELECT * FROM CustomerInfo WHERE ID = " & UserbeingEdited 

请删除"'"并使用上面的代码。