switch问题
.................................switch(RBL.selectitem.text)
{
case "产品型号":
string StrSql="select *........................................................"
break;
case ".....":
string StrSql="select * ................"
break;
default:
break;
}
SqlDataAdapter Da=new SqlDataAdapter(StrSql,StrConnection);
.........................................................
上面段句子在运行时提示:"StrSql没有定义",我在switch前面加个string StrSql;此时又提示StrSql没有付值.
请问这是怎么一回事?