I have the following type of code:
String strGroup = Request.QueryString["group"];
switch(strGroup.ToString){
case "Clients":
// do something here
break;
case "Addresses":
// do something here
break;
case "Matters":
// do something here
break;
case "Individuals":
// do something here
break;
case "Organisations":
// do something here
break;
default:
break;
}
But it’s giving the following error:
A value of an integral type expected
for
switch(strGroup.ToString){
Since strGroup is already a string, can’t you just do the following and avoid a redundant call to .ToString()?