支持SQLSERVER、Oracle、MySQL、sqlite、access等oldeb连接。
以sqlserver为例
DBUtil.IDbAccess iDb =DBUtil.IDBFactory.CreateIDB("DataSource=.;Initial Catalog=JACKOA;User ID=sa;PassWord=sa;","SQLSERVER");
String CreateUserName = iDb.GetFirstColumnString("select Name from SysUser where ID='1'");
DataTable dt = iDb. GetDataTable(“select * from sysuser”)
DataSet ds = iDb. GetDataSet(“select * from sysuserselect * from sysrole”)
iDb. ExecuteSql(“update sysuser setpwd=1”)
iDb.JudgeTableOrViewExist(“sysuser”)
iDb.JudgeColumnExist(“sysuser”,”id”)
GetSqlForPageSize(“select name,id,pwd from sysuser”, “orderby id asc”, 5,1)
iDb. BeginTrans()
iDb.Commit();
iDb.Rollback();
iDb.CreatePara()
GetDateFilter(“birthday”, “1990-01-01”, “2000-01-01”, true,true)
Hashtable ht = new Hashtable();
ht.Add(“Remark”,”备注”);
iDb.UpdateData("F_GWSW",ht, " AND CaseNo='GWFW2016011200001'");
Hashtable ht = new Hashtable();
ht.Add(“CaseNo”,”GWFW2015020100003”);
ht.Add(“Remark”,”备注”);
iDb.AddData("F_GWSW",ht)
iDb.DeleteTableRow("F_GWSW",”and caseno=’2015020300002’”)
github地址:https://github.com/jackletter/DBUtil
新闻热点
疑难解答