首先定义数据库操作的标准接口IDBAccess,定义接口的基本功能;
通过基本的接口设置,完成数据访问的统一抽象。
publicinterface IDBAccess
...{
void Init(string strServer, string strDataBase, string strUser, string strPwd);
void Open();
void Close();
bool TestConn();
int RunNoQuery(string strCmd);
DataTable RunQuery(string strCmd);
DBType DBType ...{ get;}
int GetFiledMax(string strTable, string strField);
DataTable Tables ...{ get; }
DataTable GetColumns();
DataTable GetColumns(string strTable);
}