大家看看我的代码有没有错,是数据库连接
llwlz 2009-12-09 10:17:59 namespace Utility
{
public static class ORAConntion
{
private static string constr = ConfigurationManager.AppSettings["ConnectionString"];
private static OracleConnection ORAConn;
public static OracleConnection GetOracleGetConnection()
{
try
{
if (ORAConn == null)
{
ORAConn = new OracleConnection(constr);
ORAConn.Open();
}
else if (ORAConn.State == ConnectionState.Closed)
{
ORAConn.Open();
}
return ORAConn;
}
catch (Exception ex)
{
throw ex;
}
}
}
}