本帖最后由 northow 于 2010-01-11 14:03:55 编辑

解决方案 »

  1.   

    写成"select MobilePhone from Teacher where Department in ('"+"科技处,基础部"+"')"这种形式
      

  2.   

    同一组的 checkbox  有一个相同的 name属性  在cs 文件中用 Form['name'] 记得用客服端控件
    得到的结果 就会是  这种13800138000,13750005000,13800000000
    你在用 string[] temp= split(',');截取  变成数组看你选了什么值 就组合成条件  传过去
    像这样 
    写  string sql_where="";
     if(temp != null){for(int i=0;i<temp.length;i++)

    if(i==0) 
     sql_where +="Department='temp[i]'"  //第一个不要加orsql_where +="or Department='temp[i]'";}}
    //在判断 性别  有这样组合上去就可以了Datatable getMobile(where)
    {
      sql =" select MobilePhone from Teacher where"+where  ;```````````
    }
      

  3.   

    谢谢~~还真完全忘了这形式...继续研究....
    有什么方法可以最方便地使获取出来的MobilePhone集合变成"号码1,号码2,号码3,号码4"的格式?
      

  4.   


    谢谢~
    for (int i = 0; i < this.Repeater1.Items.Count; i++)
            {
                CheckBox cbx = (CheckBox)Repeater1.Items[i].FindControl("cbDepartment");
                if (cbx != null)
                {
                    if (cbx.Checked)
                    {
                        ....
                    }
                }
            }