下载地址:https://files.cnblogs.com/ballpenxp/DBOperate3.rar
创建:
m_CDBOperate = new CDBOperate(DBType.ORACLE, ConnStr);
m_DB = new DataBase(m_CDBOperate);
使用:
Insert:
ExpEMS ems = new ExpEMS();
ems.Target = txtTarget.Text.Trim();
...
ems.DB = m_DB;
ems.Presistence();
Update:
ems = m_DB.Get<ExpEMS>("ID");
ems.Target = txtTarget.Text.Trim();
...
ems.DB = m_DB;
ems.Presistence();
Delete:
ems.ID = ID;
ems.Delete();
ems.DB = m_DB;
ems.Presistence();
Get:
List<ExpEMS>lst = m_DB.Select<ExpEMS>();
ExpEMS定义:
[TableInfo("T_EXPENSE_TYPE_EMS")]
public class ExpEMS : EntityBase
{
string _Target = "";
[ColumnInfo("Target", DataType.String)]
public string Target
{
get
{
return this._Target;
}
set
{
this._Target = value;
this.State = EntityState.Changed;
}
}
}