I am defining my array incorrectly what is wrong with this code.I want to assign the array conditionally?
string[] FieldsToCheck;
switch (TableToUSe)
{
case "PROGRAM":
FieldsToCheck = {"street_address" , "street_number"};
//{"name,street_number","street_address","zip,inf_rate","inf_rate_pt","tod_rate","tod_rate_pt","prs_rate","prs_rate_pt","sch_rate","sch_rate_pt"}
break;
case "CHILD":
FieldsToCheck[] = { "enroll_startdt1","enroll_term_code1","enroll_enddt1","enroll_startdt0",
"enroll_term_code0","enroll_enddt0","enroll_term_code2","enroll_enddt2",
"enroll_dropdt2","birthdt","reas_care_code1","enroll_dropdt1","enroll_dropdt0"};
break;
case "CASEREC":
FieldsToCheck[] = {"pa_number","pa_suffix","pa_line","ssn_mother",
"ssn_father","reas_care_code1","claim_codesdt","status_code","recertmmyy",
"last_name","first_name","caseclose_code","comments1","comments2","comments3"};
break;
case "HOME":
FieldsToCheck[] = {"ssn_fid","prev2_pgm","last_name","first_name","street_number",
"street,apt","zip,inf_rate","inf_rate_pt","tod_rate","tod_rate_pt","prs_rate",
"prs_rate_pt","sch_rate","sch_rate_pt","license_type","program_num3"};
break;
default:
return;
break;
}
string[] FieldsToCheck;
switch (TableToUSe)
{
case "PROGRAM":
FieldsToCheck = {"street_address" , "street_number"};
//{"name,street_number","street_address","zip,inf_rate","inf_rate_pt","tod_rate","tod_rate_pt","prs_rate","prs_rate_pt","sch_rate","sch_rate_pt"}
break;
case "CHILD":
FieldsToCheck[] = { "enroll_startdt1","enroll_term_code1","enroll_enddt1","enroll_startdt0",
"enroll_term_code0","enroll_enddt0","enroll_term_code2","enroll_enddt2",
"enroll_dropdt2","birthdt","reas_care_code1","enroll_dropdt1","enroll_dropdt0"};
break;
case "CASEREC":
FieldsToCheck[] = {"pa_number","pa_suffix","pa_line","ssn_mother",
"ssn_father","reas_care_code1","claim_codesdt","status_code","recertmmyy",
"last_name","first_name","caseclose_code","comments1","comments2","comments3"};
break;
case "HOME":
FieldsToCheck[] = {"ssn_fid","prev2_pgm","last_name","first_name","street_number",
"street,apt","zip,inf_rate","inf_rate_pt","tod_rate","tod_rate_pt","prs_rate",
"prs_rate_pt","sch_rate","sch_rate_pt","license_type","program_num3"};
break;
default:
return;
break;
}