Click here to Skip to main content
16,015,583 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
hi dear...
i got a error....in below code...

C#
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;
Posted
Updated 3-May-10 1:04am
v2

1 solution

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.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900