《Professional C#》中有此描述!的函数可以这样写public dataset getdata(SqlParameterCollection ps[]);
这样你调用时就可以这样写getdata(spName,sp2,sp3...)

解决方案 »

  1.   

    public void foo(params object []list)
      

  2.   

    你把存储过程写在数据库里,然后在.NET里调用不就完了!!
      

  3.   

    public dataset getdata(string ProcName,SqlParameter[] strParams); blue7() 的方法也可以,但是效率低
      

  4.   

    请dajianshi(拔剑四顾心茫然)仁兄,写一个简单例子好吗?里面要有:
       1)在函数中是怎么用ps[]的。
       2)调用前是怎么用的 , 谢谢
      

  5.   

    private void Parameters(SqlCommand command,SqlParameter[] cmdParameter)
    { foreach(SqlParameter p in cmdParameter)
    {
    if ((p.Direction==ParameterDirection.InputOutput) && (p.Value==null))
    {
    p.Value=DBNull.Value ;
    }
    command.Parameters.Add(p);
    }

    }