none
Timeout 时间已到 RRS feed

  • 问题

  • public DataTable GetDataTable(string sql, params SqlParameter[] values)
      {
      DataSet ds = new DataSet();
      SqlCommand cmd = new SqlCommand(sql, Connection);
      cmd.CommandType = CommandType.StoredProcedure;
      cmd.Parameters.AddRange(values);
      SqlDataAdapter da = new SqlDataAdapter(cmd);
      da.Fill(ds);
    问题一:“Timeout 时间已到。在操作完成之前超时时间已过或服务器未响应。”,总是提示这个错误,为什么呢??? 
    这是什么错误呢??? 怎样解决???

    问题二:“SqlCommand 类”的“CommandTimeout”属性的作用是什么?  错误如下图:

    问题三:这是什么错误,怎么回事?   图如下:

        


      connection.Close();
      //connection.Dispose();
      return ds.Tables[0];
      }


    执行的存储过程如下:
      ALTER proc [dbo].[GetSimulationBasicData]
    @BeginTime char(10),
    @EndTime char(10),
    @BuildingNo char(20),

    @MeterType char(4)
    as
    declare @BuildingName nvarchar(50)
    set @BuildingName = (select BuildingName from Building where BuildingNo=@BuildingNo)
    insert into SimulationBasicData(DANo,BuildingNo,BuildingName,MeterType,DADay,DAHour,SumQty,Unit)
    select (DADay+DAHour) DANo,@BuildingNo BuildingNo,@BuildingName BuildingName,MeterType,DADay,DAHour, SUM(SumQty) SumQty ,Unit  
    from EnergyDataSumByHourN e where not exists(select DANo,BuildingNo,BuildingName,MeterType,DADay,DAHour,SumQty,Unit from SimulationBasicData s where (e.DADay+e.DAHour)=s.DANo)
    and
    MeterType=@MeterType and (DADay+DAHour) between @BeginTime and @EndTime group by (DADay+DAHour),MeterType,DADay,DAHour,Unit
    order by (DADay+DAHour)
    select * from SimulationBasicData where DANo between @BeginTime and @EndTime



    有精到广,做出自己的特色。

    2012年4月25日 8:51

答案

全部回复