本帖最后由 lm1473 于 2012-11-12 15:55:48 编辑

解决方案 »

  1.   


    string s = string.Empty;
    if (A == 1)
      s = "A";
    else if (A == 2)
      s = "B";
    else
      s = "C";
    Content(s);
      

  2.   

    Content(sqlstr);

    protected void Content(string s)
    {
       连接数据库
       读取数据
       显示内容到Textbox上
    }
    的参数不一致,按楼上的逻辑即可,switch....case也可
      

  3.   

    string sqlstr="";
    switch(A)  
    {
      case 1:
           sqlstr="1";
           break;
      case 2:
           sqlstr="2";
           break;
      case 3:
          sqlstr="3";
           break;
     }
     Content(sqlstr);
      

  4.   


    protected void Content(A的直)
    {
    if(A==1)//判断写里面
    {
     sqlstr="......";
    }
    if(A==2) 
    {
     sqlstr="......";
    }
       连接数据库
       读取数据
       显示内容到Textbox上
    }