上一篇文章讲述了怎样插入一条记录,这里补充一下查询、修改和删除一条记录。相对插入而言,查询、修改和删除容易得多,下面分别给出我的一种实现:
1.查询:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
2. 更新:
ADO.Net 2.0中新增了一项功能:DataRow提供SetModified和SetAdded方法来改变其状态。上一篇文章中讲到,执行emps.FromXml之后,DataRow的状态为Added,这里我们可以将DataRow的状态改为Modified,当调用Save时,即可实现更新功能。
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
3. 删除:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif?x-oss-process=image/resize,w_1400/format,webp)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif?x-oss-process=image/resize,w_1400/format,webp)
现在还没有好的dOOdads模板来生成支持Web Service的业务实体,相信不久的将来会有的……
本文转自Silent Void博客园博客,原文链接:http://www.cnblogs.com/happyhippy/archive/2006/08/23/601236.html,如需转载请自行联系原作者