覆盖int ExecuteNonQuery() [英] override int ExecuteNonQuery()

查看:88
本文介绍了覆盖int ExecuteNonQuery()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何以及在何处覆盖orcaleCommand的c#应用程序中的ExecuteNonQuery()

how and where can i override the ExecuteNonQuery() in c# application for orcaleCommand

public override int ExecuteNonQuery()
{
//myCode
}



这是函数,但是我不知道我应该在应用程序中的什么地方写



this is the function but i don''t know where i should write it in the application

推荐答案

,只要您没有将其声明为抽象,就不要需要重写.
as long as you have it not declared abstract you don''t need override.


为了重写您首先必须继承类OracleCommand的方法,这是不可能的,因为密封了OracleCommand.
因此,您将必须找到另一种方式来实现所需的功能,例如包装程序中的丑陋外观会为您提供帮助.
inorder to override the method you first have to inherit the class OracleCommand and that is not possible as OracleCommand is sealed.
So you''ll have to find another way to achieve what you want, like something as ugly as a wrapper would help you.


这篇关于覆盖int ExecuteNonQuery()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆