现在的位置: 首页 > 综合 > 正文

WebService发布问题

2013年10月21日 ⁄ 综合 ⁄ 共 1215字 ⁄ 字号 评论关闭

WebService写好后的发布问题,直接发布太多内容了不好,应该先新建个文件夹,然后用VS工具把源代码发布进这个文件夹后,再把该文件夹放到服务器上,如果服务器上的文件夹没有设置为共享,则服务器里能用外网地址访问,本机用外网地址则不能访问,必然把它设置为共享

============exists 好久没用了

select mScore from OA_Assess_Score where assessType='纪律方面' and assessName='李明' and assessMonth='2012-12-01'
union all 
select mScore from OA_Assess_Score where assessType='积极方面' and assessName='李明' and assessMonth='2012-12-01'

==下面这种写法

select mScore from OA_Assess_Score where assessType in('纪律方面','积极方面') and assessName='李明' and assessMonth='2012-12-01'

SqlDataAdapter已经填充完了DataSet就可以关闭数据库

 [WebMethod]
        //查询用户名和密码
        public DataSet selectAll()
        {

 SqlConnection con = new SqlConnection("server=58.32.238.6,8888;database=LfxSh;uid=sa;pwd=wearemedata;Enlist=true;Pooling=true;Max Pool Size=300;Min Pool Size=0;Connection Lifetime=300;packet size=1000");

//为了解决->超时时间已到。超时时间已到,但是尚未从池中获取连接。出现这种情况可能是因为所有池连接均在使用,并且达到了最大池大小。得加下面这句
        //;Enlist=true;Pooling=true;Max Pool Size=300;Min Pool Size=0;Connection Lifetime=300;packet size=1000
                con.Open();
                string sql = "select User_Id,User_Name,User_Password from OA_UserInfo";
                SqlCommand cmd = new SqlCommand(sql, con);
                SqlDataAdapter sda = new SqlDataAdapter(cmd);
                DataSet ds = new DataSet();
                sda.Fill(ds);
                con.Close();
                return ds;
         }

抱歉!评论已关闭.