日期:2014-05-18 浏览次数:20751 次
public static IDataAccess CreateDataAccess() { string conStr = ConfigurationManager.ConnectionStrings["connStr"].ToString(); string conType = ConfigurationManager.ConnectionStrings["connType"].ToString(); switch (conType) { case "MSSQL": return new MSSQLDAL(conStr); case "ORACLE": return new ORACLEDAL(conStr); default: throw new Exception("不支持的类型!"); } }