【问题标题】:Grouping OracleCommand in .NET在 .NET 中对 OracleCommand 进行分组
【发布时间】:2009-08-25 05:53:54
【问题描述】:

是否可以对 OracleCommand 对象进行分组并遍历集合中的每个 OracleCommand?

有人可以发布一个示例代码来实现这一点吗?

谢谢。

安杰洛

【问题讨论】:

    标签: .net collections oraclecommand


    【解决方案1】:

    您可以定义一个 List 并对其项目进行迭代:

    //define a command
    OracleCommand cmd1 = new OracleCommand("command", connection);
    //set parameters if necessary
    ...
    //do things
    ...
    
    //declare a List of command
    List<OracleCommand> commands = new List<OracleCommand>();
    commands.Add(cmd1);
    
    //using the list
    foreach (OracleCommand command in commands)
    {
         //...execute command and stuff
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-09-24
      • 1970-01-01
      • 2021-04-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-02
      相关资源
      最近更新 更多