use dataset with case statement
-
Hi i populate dataset with data from uif table and one of the colum is marriage status which is integer so i want to you case statement where for example if marriage_status is 1 then it has to display single on detailsview. here is my code int MarriageStatus = (int)dataset.Tables["uif"].Rows[0]["marriage_stat"]; string status = Convert.ToString(MarriageStatus); switch(MarriageStatus){ case 0: status="Single"; break; case 1: status="Single"; break; case 2: status = "married"; break; case 3: status="Widowed"; break; case 4: status="Divorced"; break; }
Mamphekgo
-
Hi i populate dataset with data from uif table and one of the colum is marriage status which is integer so i want to you case statement where for example if marriage_status is 1 then it has to display single on detailsview. here is my code int MarriageStatus = (int)dataset.Tables["uif"].Rows[0]["marriage_stat"]; string status = Convert.ToString(MarriageStatus); switch(MarriageStatus){ case 0: status="Single"; break; case 1: status="Single"; break; case 2: status = "married"; break; case 3: status="Widowed"; break; case 4: status="Divorced"; break; }
Mamphekgo
And you problem is? You could have
Case 0: Case 1: status = "Single" break; case 2:
Never underestimate the power of human stupidity RAH