无效的排名说明符:预期为','或']' [英] Invalid rank specifier: expected ',' or ']'

查看:86
本文介绍了无效的排名说明符:预期为','或']'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨亲爱的...
我在下面的代码中遇到了一个错误....

库lib =  Library();
         foreach (GridViewRow行 in  grdAdminInitiate.Rows中的行)
        {
            sEmpCode = row.Cells [ 0 ].Text.Trim();
            sGrade = row.Cells [ 3 ].Text.Trim();
            sStatus = row.Cells [ 8 ].Text.Trim();
            sToEmail = row.Cells [ 4 ].Text.Trim();

            字符串 [] ArrGrade =  字符串 [  7 ] {" " "  M-10"  M-9"" "  M-7"  M-6"" "  M-4"  M- 3"  M-2"  M-1"};
             int  iIsMailSentForSelf =  0 ; 

解决方案

ArrGrade的长度为7,但指定了12个项目.编译器应该做成多少大小?如果您不使用7,则编译器会根据您使用其初始化的项目数来自行计算出它需要多大.


hi dear...
i got a error....in below code...

Library lib = new Library();
        foreach (GridViewRow row in grdAdminInitiate.Rows)
        {
            sEmpCode = row.Cells[0].Text.Trim();
            sGrade = row.Cells[3].Text.Trim();
            sStatus = row.Cells[8].Text.Trim();
            sToEmail = row.Cells[4].Text.Trim();

            String[] ArrGrade = new String[7] { "M-12", "M-11", "M-10", "M-9", "M-8", "M-7", "M-6", "M-5", "M-4", "M-3", "M-2", "M-1" };
            int iIsMailSentForSelf = 0;

解决方案

ArrGrade is declared with a length of 7 but 12 items are specified. What''s size should the compiler make it? If you get rid of the 7 then the compiler will figure out for itself how big it needs to be based on how many items you initialize it with.


这篇关于无效的排名说明符:预期为','或']'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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