指定转换无效
namespace OracleDAL
{
public class OracleProvider:IDAL.IProduce
{
private string connStr = OracleMsgHelper.ConnectionString;
#region IProduce 成员
public void GetContent(out int testValue)
{
testValue=0;
OracleConnection conn = new OracleConnection(connStr);
string sql = "GetTestValue";
OracleCommand comm = new OracleCommand(sql, conn);
OracleParameter pContent =
new OracleParameter("p_testValue", OracleType.Number);
pContent.Direction = ParameterDirection.Output;
comm.CommandType = CommandType.StoredProcedure;
comm.Parameters.Add(pContent);
try
{
conn.Open();
int count = comm.ExecuteNonQuery();
testValue = (int)pContent.Value;//运行到此处出现指定的转换无效,之前程序都无问题,并且pContent.Value已取到值.另外此程序数据库是oracle,在sql server 2000却不会出现些异常
}
catch
{
}
finally
{
conn.Close();
}
}
#endregion
}
}