自己弄了一种数据层的实现,大致划为:1[A]+1[B]+N三类文件
1[A],数据层对外入口:接受connType, connstr,返回入口实例。
public class MyInterface{public MyInterface(){string _connType, string _connStr}};
2[B], 数据处理接口:
public interface DbAction{DataTable SelectList(string _sqlStr);}
N[父类],虚类:
class DbManager:MyInterface.DbAction{ public virtual DataTable SelectList(string _sqlStr){}
N[子类],实现,每种数据库对应一种实现:
class DbMsSql:MyInterface.DbAction{ public DataTable SelectList(string _sqlStr){}