2 sunfan369378633 sunfan369378633 于 2014.05.04 21:39 提问

“必须声明变量@strClientCode” 为什么老是提示这个错误啊

StringBuilder strSql = new StringBuilder();
strSql.Append("insert into strImage (strClientCode,images,dateTM) ");
strSql.Append(" values ( ");
strSql.Append("@strClientCode,@images,@dateTM)");
SqlParameter[] paramers ={

new SqlParameter("@strClientCode",SqlDbType.VarChar,30),
new SqlParameter("@images",SqlDbType.Image, 16),
new SqlParameter("@dateTM",SqlDbType.DateTime)
};

        paramers[0].Value = strClientCode;
        paramers[1].Value =bytes;
        paramers[2].Value = DateTime.Now;

        pbClass.ExecuteNonQuery(strSql.ToString());
Csdn user default icon
上传中...
上传图片
插入图片