C# ACCESS 查询提示“至少一个参数没有被指定”问题

 错误的SQL指令如下:

    sqlStr = “select * from  tb_userInfo where userName=” + userName;    //错误的 sql 指令

正确的SQL指令如下:

    sqlStr = “select * from  tb_userInfo where userName=‘’” + userName + “'”;    //正确的sql指令

错误原因:userName是文本格式 , userName 左右都须加单引号 ' 。

原文地址:https://www.cnblogs.com/Waming-zhen/p/7157253.html