﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>博客园-Artech-随笔分类-C. ADO.NET</title><link>http://www.cnblogs.com/artech/category/76632.html</link><description>Develop every application as an art using the most suitable technologies!</description><language>zh-cn</language><lastBuildDate>Thu, 09 Apr 2009 03:22:40 GMT</lastBuildDate><pubDate>Thu, 09 Apr 2009 03:22:40 GMT</pubDate><ttl>60</ttl><item><title>[原创-总结]谈谈基于SQL Server 的Exception Handling</title><link>http://www.cnblogs.com/artech/archive/2008/08/28/1278580.html</link><dc:creator>Artech</dc:creator><author>Artech</author><pubDate>Thu, 28 Aug 2008 05:44:00 GMT</pubDate><guid>http://www.cnblogs.com/artech/archive/2008/08/28/1278580.html</guid><wfw:comment>http://www.cnblogs.com/artech/comments/1278580.html</wfw:comment><comments>http://www.cnblogs.com/artech/archive/2008/08/28/1278580.html#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://www.cnblogs.com/artech/comments/commentRss/1278580.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/artech/services/trackbacks/1278580.html</trackback:ping><description><![CDATA[摘要: 对于所有的开发人员来说，Exception Handling是我们每天都要面对的事情。对于基于Source Code的Exception Handling，我想大家已经司空见惯了，但是对于Database级别的Exception Handling，就没有那么常见了。在这篇文章中，我将会介绍我对于基于Database编程中Exception Handling的一些粗浅的认识：在编写Stored Procedure时，如何抛出一个可预知的Exception，ADO.NET如何处理从Database抛出的Exception，如何保存基于Database Exception的Error Message，如何在Database和.NET Application之间进行消息的传递[注：这里的Database主要指SQL Server]。&nbsp;&nbsp;<a href='http://www.cnblogs.com/artech/archive/2008/08/28/1278580.html'>阅读全文</a><img src ="http://www.cnblogs.com/artech/aggbug/1278580.html?type=1" width = "1" height = "1" />]]></description></item><item><title>[原创]谈谈基于SQL Server 的Exception Handling - PART III</title><link>http://www.cnblogs.com/artech/archive/2007/12/17/1002857.html</link><dc:creator>Artech</dc:creator><author>Artech</author><pubDate>Mon, 17 Dec 2007 04:53:00 GMT</pubDate><guid>http://www.cnblogs.com/artech/archive/2007/12/17/1002857.html</guid><wfw:comment>http://www.cnblogs.com/artech/comments/1002857.html</wfw:comment><comments>http://www.cnblogs.com/artech/archive/2007/12/17/1002857.html#Feedback</comments><slash:comments>10</slash:comments><wfw:commentRss>http://www.cnblogs.com/artech/comments/commentRss/1002857.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/artech/services/trackbacks/1002857.html</trackback:ping><description><![CDATA[摘要: 在<a href="http://www.cnblogs.com/artech/archive/2007/12/17/997209.html" target="_blank">谈谈基于SQL Server 的Exception Handling - PART II</a>中，我给出了一个完整的例子说明了：如何在将message定义在sys.messages中保证message的一致性和可维护性；如何在Stored procedure中使用RAISERROR将一个可预知的Error抛出；如何在Stored procedure中使用TRY/CATCH进行异常的捕捉；在Application如果处理从SQL Server抛出的Exception。实际上，SQL Server database Engine抛出、被我们的.NET最终捕获的SqlException，我们通过SqlException的属性可以得到Error的相关信息。下面是SqlException的属性列表：&nbsp;&nbsp;<a href='http://www.cnblogs.com/artech/archive/2007/12/17/1002857.html'>阅读全文</a><img src ="http://www.cnblogs.com/artech/aggbug/1002857.html?type=1" width = "1" height = "1" />]]></description></item><item><title>[原创]谈谈基于SQL Server 的Exception Handling - PART II</title><link>http://www.cnblogs.com/artech/archive/2007/12/17/997209.html</link><dc:creator>Artech</dc:creator><author>Artech</author><pubDate>Mon, 17 Dec 2007 04:41:00 GMT</pubDate><guid>http://www.cnblogs.com/artech/archive/2007/12/17/997209.html</guid><wfw:comment>http://www.cnblogs.com/artech/comments/997209.html</wfw:comment><comments>http://www.cnblogs.com/artech/archive/2007/12/17/997209.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.cnblogs.com/artech/comments/commentRss/997209.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/artech/services/trackbacks/997209.html</trackback:ping><description><![CDATA[摘要: 在<a href="http://www.cnblogs.com/artech/archive/2007/12/17/997182.html" target="_blank">上面一节</a>中，我通过RAISERROR重写了创建User的Stored procedure，实际上上面的Stored procedure是有问题的。我之所以没有立即指出，是因为这是一个很容易犯的错误，尤其是习惯了.NET Exception Handling的人更容易犯这样的错误。我们知道在.NET Application中，如果出现一个未处理的Exception，程序将立即终止，后续的程序将不会执行，但是对于上面的SQL则不一样，虽然我们通过RAISERROR将Error抛出，但是SQL的指定并不会被终止，INSERT语句仍然会被执行的。我想很多人会说在RAISERROR后加一个Return就可以了嘛。不错这是一个常用的解决方案，但是我不倾向于使用这种方法。为了更清楚地说明这个问题，我们举另一个相关的例子，上面我们介绍了创建User的例子，我们现在来引入另一个例子：如何将一个User添加到一个Role里面&nbsp;&nbsp;<a href='http://www.cnblogs.com/artech/archive/2007/12/17/997209.html'>阅读全文</a><img src ="http://www.cnblogs.com/artech/aggbug/997209.html?type=1" width = "1" height = "1" />]]></description></item><item><title>[原创]谈谈基于SQL Server 的Exception Handling - PART I</title><link>http://www.cnblogs.com/artech/archive/2007/12/17/997182.html</link><dc:creator>Artech</dc:creator><author>Artech</author><pubDate>Mon, 17 Dec 2007 00:38:00 GMT</pubDate><guid>http://www.cnblogs.com/artech/archive/2007/12/17/997182.html</guid><wfw:comment>http://www.cnblogs.com/artech/comments/997182.html</wfw:comment><comments>http://www.cnblogs.com/artech/archive/2007/12/17/997182.html#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://www.cnblogs.com/artech/comments/commentRss/997182.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/artech/services/trackbacks/997182.html</trackback:ping><description><![CDATA[摘要: 对于所有的开发人员来说，Exception Handling是我们每天都要面对的事情。对于基于Source Code的Exception Handling，我想大家已经司空见惯了，但是对于Database级别的Exception Handling，就没有那么常见了。在这篇文章中，我将会介绍我对于基于Database编程中Exception Handling的一些粗浅的认识：在编写Stored Procedure时，如何抛出一个可预知的Exception，ADO.NET如何处理从Database抛出的Exception，如何保存基于Database Exception的Error Message，如何在Database和.NET Application之间进行消息的传递[注：这里的Database主要指SQL Server]。&nbsp;&nbsp;<a href='http://www.cnblogs.com/artech/archive/2007/12/17/997182.html'>阅读全文</a><img src ="http://www.cnblogs.com/artech/aggbug/997182.html?type=1" width = "1" height = "1" />]]></description></item><item><title>[原创]我的ORM: 开发自己的Data Access Application Block - Part I</title><link>http://www.cnblogs.com/artech/archive/2007/04/03/698755.html</link><dc:creator>Artech</dc:creator><author>Artech</author><pubDate>Tue, 03 Apr 2007 10:55:00 GMT</pubDate><guid>http://www.cnblogs.com/artech/archive/2007/04/03/698755.html</guid><wfw:comment>http://www.cnblogs.com/artech/comments/698755.html</wfw:comment><comments>http://www.cnblogs.com/artech/archive/2007/04/03/698755.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.cnblogs.com/artech/comments/commentRss/698755.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/artech/services/trackbacks/698755.html</trackback:ping><description><![CDATA[摘要: 经常在网上看到对ORM的讨论沸沸扬扬，我也来凑个热闹，谈谈我写的一个ORM。最近在做一项工作，把我们经常用到的一些业务逻辑抽象出来，写成一个个的Application Block，使之可以运用到不同的Application中，比如Data Access，Messaging，Auditing，Data binding等等。现在先做一个Data access application block。由于时间仓促，没有进行什么优化和较多的测试，大家不必深究我所提供的Code ,我只希望为大家的ORM提供另一种想法。&nbsp;&nbsp;<a href='http://www.cnblogs.com/artech/archive/2007/04/03/698755.html'>阅读全文</a><img src ="http://www.cnblogs.com/artech/aggbug/698755.html?type=1" width = "1" height = "1" />]]></description></item></channel></rss>