在中实现层架构物业
public DACustomer(BOCustomer cus)
{
// A reference of the business object class
}
//standard dataset function that adds a new customer
public void Add(BOCustomer cus)
{
String str = BuildAddString(cus);
OpenCnn();
//Open command option - cnn parameter is imporant
OleDbCommand cmd = new OleDbCommand(str,cnn);
//execute connection
ecuteNonQuery();
// close connection
CloseCnn();
}
//standard dataset function that updates
//details of a customer based on ID
public void Update(BOCustomer cus)
{
20多分钟后 OpenCnn();
String selectStr = \"UPDATE \" + thisTable +
\" set \" + cus_LName + \" = \'\'\" + ame + \"\'\'\" +
\", \" + cus_FName + \" = \'\'\" + ame + \"\'\'\" +
\", \" + cus_Address + \" = \'\'\" + dress + \"\'\'\" +
\", \" + cus_Tel + \" = \'\'\" + l + \"\'\'\" +
\" where cus_ID = \'\'\" + sID + \"\'\'\";
OleDbCommand cmd = new OleDbCommand(selectStr,cnn);
ecuteNonQuery();
CloseCnn();
}
//standard dataset function that finds and
//return the detail of a customer in a dataset
public DataSet Find(String argStr)
{
DataSet ds=null;
try
{
OpenCnn();
String selectStr = \"select * from \" + thisTable +
\" where cus_ID = \'\'\" + argStr + \"\'\'\";
OleDbDataAdapter da =
new OleDbDataAdapter(selectStr,cnn);
ds = new DataSet();
ll(ds,thisTable);
CloseCnn();
}
catch(Exception e)
{
String Str = ssage;
}
return ds;
}
private void OpenCnn()
{
// initialise connection
String cnnStr = CnnStr;
cnn = new OleDbConnection(cnnStr);
// open connection
en();
}
private void CloseCnn()
{
// 5- step five
ose();
}
// just a supporting function that builds
// and return the insert string for dataset.
private String BuildAddString(BOCustomer cus)
{
// these are the constants as
// set in the top of this module.
strTable=\"Insert into \" + thisTable;
strFields=\" (\" + cus_ID +
\",\" + cus_LName +
\",\" + cus_FName +
\",\" + cus_Address +
\",\" + cus_Tel + \")\";
//these are the attributes of the
//customer business object.
strValues= \" Values ( \'\'\" + sID +
\"\'\' , \'\'\" + ame +
\"\'\' , \'\'\" + ame +
\"\'\' , \'\'\" + dress +
\"\'\' , \'\'\" + l + \"\'\' )\";
insertStr = strTable + strFields + strValues;
return insertStr;
}
}
}
为什么会得阿尔茨海默病重庆盆腔炎治疗哪家好
银川好白癜风医院
- 上一页:在中实现层架构
- 下一页:在中应用实现上传计划
-
为什么有钱人和穷人都想退出同学群集?背后的原因很现实,很无奈
除此以外我推测了一个奇怪的现象, 明明手机号都换回了好几个, 但是微信...
2024-07-23
-
驻新加坡中国大使馆将开展远程视频公证试点
中新网4年底19日电 据中国人领事新加坡大东交民巷微信公众号消息,自2022年...
2023-11-21
-
苹果VR/AR头盔曝光 传了10年的死讯终于要实现了吗?
【CNMO新闻网】自2019年风生水起的VR/AR概念,到2021年大热的“元时空”。三巨...
2023-11-12
-
消息称华为将于 6 月初释出 Freebuds Pro 2 耳机等新品
IT之家 5 月末 22 日最新消息,视像该网站 @东都数君 透露,三星将于 6 月末初...
2023-10-31
-
千万不要随便穿著肉色的衣服…哈哈哈哈狠狠代入了!
以前的宝子们 有不会一如既往地持续保持好心情呢 如果不会也就让 以前的开...
2023-10-23
-
【中医妇科】肚子大的像男婴竟是巨大肌瘤惹的祸!
嘴巴大的像仰孕 身怀极大脊髓刺毛惹的祸! 本期研究专家: 佟庆 北京中...
2023-10-22