有关cmd.Parameters.Clear()

// detach the SqlParameters from the command object, so they can be used again.
cmd.Parameters.Clear();

   这句话在某些时候非常有用,比如说你在一个事务中调用了2个以上的存储过程,而恰巧这两个存储过程又有同样的参数,(例如 @p_Name) 这时不加cmd.Parameters.Clear() 就会出现异常.
  以上文章引用自:http://community.csdn.net/Expert/topic/5352/5352906.xml?temp=.1562769

posted on 2007-02-13 16:07  min.jiang  阅读(2173)  评论(0编辑  收藏  举报