菜鸟求助:
if (FrmLogin.DBKind == 0){
SqlConnection con = (SqlConnection)DBKindCope.con3;
SqlCommand cmd = (SqlCommand)DBKindCope.cmd3;
SqlDataReader dr = (SqlDataReader)DBKindCope.dr3;
con.Open()
}
else
{
OracleConnection con = (OracleConnection)DBKindCope.con3;
OracleCommand cmd = (OracleCommand)DBKindCope.cmd3;
OracleDataReader dr = (OracleDataReader)DBKindCope.dr3;
con.Open();
}
这里DBKindCope.con3,....是DBKindCope类里的static object类型的变量,已经在该类中装箱了,这里在if...else中拆箱。
可是出了if.....else,这里的con,cmd,dr就识别不了,怎么办呢?
[[it] 本帖最后由 jqc304 于 2008-10-20 17:51 编辑 [/it]]