المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Getting Error In For each



C# Programming
11-29-2009, 04:30 AM
string str2= "";
foreach ( str2 in this.String_Array)
{
if (str2 != "")
{
flag2 = true;
break;
}
}

Error is Cannot assign to 'str' because it is a 'foreach iteration variable'
Error Type and identifier are both required in a foreach statement

If you can think then I Can.