今天改.net代码遇到一个问题
列名 'test_id' 无效。 列名 'id' 无效。 列名 'test_id' 无效。 列名 'test_type
提示列名无效,新加的代码明明是按照项目里其他代码写的,后来我下方代码做了修改:
改之前:
strSql.Append("select id,test_id,test_type,produce_type ");
strSql.Append(" where test_id=@test_id");
改之后:
strSql.Append("select id,test_id,test_type,produce_type ");
strSql.Append(" FROM expenses_assess_information_detail ");
strSql.Append(" where test_id=@test_id");
原来的代码是没有From语句的,还能执行成功也不知道为啥,加了这一条语句之后就可以了!