c#下各种数据库操作的封装!(支持ACCESS,SQLSERVER,DB2,ORACLE,MYSQL)(一)

来源:互联网 发布:telnet linux 安装 编辑:程序博客网 时间:2024/06/08 13:51

首先定义数据库操作的标准接口IDBAccess,定义接口的基本功能;

通过基本的接口设置,完成数据访问的统一抽象。

public interface 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);
    }


Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=2242981

 
原创粉丝点击