public DataSet exeSelectNSql(String[,] sqlStrTable)
{
    int i, strLen;
    strLen = sqlStrTable.Length / 2;  //这句什么意思??
    for (i = 0; i < strLen; i++)
    {
        .........
    }
}

解决方案 »

  1.   

    这是全部代码:
        public DataSet exeSelectNSql(String[,] sqlStrTable)
        {
            int i, strLen;
            strLen = sqlStrTable.Length / 2;
            DataSet myDs = new DataSet();
            this.Adapter = new SqlDataAdapter();
            for (i = 0; i < strLen; i++)
            {
                this.myCommand = new SqlCommand(sqlStrTable[i, 0], this.myConn);
                this.myConn.Open();
                this.Adapter.SelectCommand = this.myCommand;            try
                {                this.Adapter.Fill(myDs, sqlStrTable[i, 1]);
                }
                catch (SqlException)
                {
                    this.myConn.Close();
                    this.myCommand.Dispose();
                    this.myCommand = null;
                    return null;
                }
                catch (ArgumentException)
                {
                    this.myConn.Close();
                    this.myCommand.Dispose();
                    this.myCommand = null;
                    return null;
                }
                this.myConn.Close();
                this.myCommand.Dispose();
                this.myCommand = null;
            }
            return myDs;
        }
      

  2.   

    没人笑话你啊。
    这个方法是干什么用的?
        for (i = 0; i < strLen; i++)
        {
            .........
        }
    省略的代码是什么?
    最好把整个方法都给出来。
      

  3.   

    int i, strLen;
    strLen = sqlStrTable.Length / 2;  //这句什么意思??sqlStrTable 是外部传递进来的一个数组,.Length 长度属性就是把数组的一半长度赋值给整型变量strLen这是一般语法
      

  4.   

    String[,] sqlStrTable
    是个2维数组吧?其长度就是他里面得元素个数吧?
      

  5.   

    Influence(野马秋风):
    我已经贴出来了啊,你看你得帖子上头
      

  6.   

    参数String[,] sqlStrTable
    传进来的是是个二维数组
    [0]是要sql语句,[1]是表名
    string[,] mat = new string[n,2]
    {
    {"select * from table1","table1"},
    {"select * from table2","table2"},
    ...
    {"select * from tablen","tablen"},
    };
    所以循环的时候只需要循环mat.Length/2也就是n*2/2=n就够了,不知道有没有表达清楚。