直接在web上运行,显示:超时时间已到。在操作完成之前超时时间已过或服务器未响应。
有谁能告知是什么问题引起。
我的源码
[WebMethod]
public DataSet GainDS(string querystr) 

try 

SqlConnection sqlcon = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["Connection"]); 

SqlDataAdapter myadapter = new SqlDataAdapter(querystr,sqlcon); 

DataSet myds = new DataSet();  
myadapter.Fill(myds); 
return myds; 

catch(Exception ex) 

throw ex; 

}

解决方案 »

  1.   

    数据量确实较大:表中有80000多条记录
    sql:
    1)select  top 1000 * from phsonlyone.dbo.history_src where  id not in ( select top 18000 id from phsonlyone.dbo.history_src where order by calltime)  order by calltime
    但执行:
    2)select  top 1000 * from phsonlyone.dbo.history_src where  id not in ( select top 17000 id from phsonlyone.dbo.history_src where order by calltime)  order by calltime
    是没问题的
    第一条sql语句在查询分析器上要50秒时间,可在web service里运行30秒就提示超时时间已到
      

  2.   

    连接串也加了Connect Timeout=300,但就还是不能执行
      

  3.   

    myadapter.SelectCommand.CommandTimeout=0;
    就可以了
      

  4.   

    80000条记录? WS超时了吧。
    建议把DataSet压缩后再传。
    压缩后仍然超时的话,就把压缩包坎开若干段,分开多次来传