数据库是sql server 2003 ?

解决方案 »

  1.   

    var sql = "select * from userInfo as a
    inner join departmentInfo as b on a.dept_id = b.dept_id
    inner join stationInfo as c on a.dept_id = c.dept_id"sql = sql + "where deptId = '" + deptId + "' and 添加你想加的条件 ......"
    最后执行sql
      

  2.   

    A 表是每条件的表,你做成视图也可以string strSql  = "select * from A where 1=1";
    要什么条件 就加 " and ??? = ???"就可以了 可以多加或不加