asp.net c# webform ORA-01008: 并非所有变量都已关联,值为null报错

原因:值为null,看看从哪里开始没有得到值吧``

比如
StringBuilder whereSql = new StringBuilder();

whereSql.Append("SELECT count(*) as username FROM ");
whereSql.Append("dzjc.dzjc_yhmc ");
whereSql.Append("WHERE ");
whereSql.Append("username=:userName ");
whereSql.Append("and ");
whereSql.Append("pwd=:pwd ");
			
//构建Sql
OracleParameter[] oParams = { new OracleParameter(":userName",OracleType.VarChar),
new OracleParameter(":pwd",OracleType.VarChar)
};
oParams[0].Value = userName;
oParams[1].Value = pwd;


pwd为null的话会造成这个错误

黑色头发:http://heisetoufa.iteye.com/

你可能感兴趣的:(C++,c,C#,asp.net,webform)