OK 내가옵니다의 3-4 분이 오류가 계속 : 그래서해야하지만 여기 제한 시간이 경과하지 않았지만 시간이 초과되었습니다 (코드 참조)?
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Source Error:
Line 93:
Line 94: DataSet getData;
Line 95: getData = SqlHelper.ExecuteDataset(ConfigurationManager.ConnectionStrings["connstr"].ConnectionString, CommandType.StoredProcedure, "Course_NewReportGet_Get_Sav", objPara);
Line 96:
Line 97: foreach (DataRow dr in getData.Tables[0].Rows)
는 내가 제대로 일을하고 있지 않다 생각, 코드, 내가 5000 초 시간 제한을 설정 다른 것. 당신은 이것이 프로 시저 호출의 중첩 루프라는 것을 알게 될 것입니다. 나는 모든 회사를 얻고 각 코스를 각 회사에 할당하고 각 코스마다 모든 사용자 활동에 대한 보고서를받습니다. comapany 당 2 ~ 70 개의 코스와 회사 당 코스 리포트 당 8 ~ 1000 명의 사용자가있는 약 250 개의 회사가 있습니다. 여기서는 많은 데이터를 다루고 있습니다. 보고서를 얻으려는 최종 호출은 꽤 큰 저장 프로 시저입니다. ...
데이터를 더 빠르고 쉽게 처리 할 수있는 새로운 형식으로 변환하려고 시도하고 있지만 지금은 구문 분석해야합니다. 우리가 가지고있는 것을 통해 새로운 방식으로 그것을 게시하십시오. 그것은 모두 동일한 데이터베이스에 있지만 정확히 SQL에서만이 모든 작업을 수행 할 수 있을지 확실하지 않습니다. 기본적으로보고 도구에서 사용하는 저장 프로 시저를 사용하여 데이터를 새 테이블에 게시합니다. 하지만 각 회사의 각 과정에 대한 절차를 실행 한 다음 각 회사의 각 과정에서 보고서에 반환 된 각 사용자에 대한 데이터를 게시 할 필요가 ... 그것은 ...
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using Mexico.Data;
public partial class admin_tools_Optimus : System.Web.UI.Page
{
protected int step = 0;
protected string[] companies = new string[260];
protected string[] coursestrings = new string[260];
protected int total = 0;
protected int[] totalcourses = new int[260];
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Proceed(object sender, EventArgs e)
{
DataSet getCompanies = SqlHelper.ExecuteDataset(ConfigurationManager.ConnectionStrings["connstr"].ConnectionString, CommandType.StoredProcedure, "Companies_All_Get");
int counter = 0;
foreach (DataRow dr in getCompanies.Tables[0].Rows)
{
lstData.Items.Add(dr["companyid"].ToString() + ": " + dr["companyname"].ToString());
companies[counter] = dr["companyid"].ToString();
counter++;
}
lblCurrentData.Text = counter.ToString() + " companies ready, click next to get all company courses.";
total = counter;
GetCompanies();
}
protected void GetCompanies()
{
string[,] courses = new string[260, 200];
for (int i = 0; i < total-1; i++)
{
DataSet getBundles = SqlHelper.ExecuteDataset(ConfigurationManager.ConnectionStrings["connstr"].ConnectionString, CommandType.StoredProcedure, "CompanyCourses_ByCompanyID_Get_Sav", new SqlParameter("@companyid", companies[i]));
int counter = 0;
foreach (DataRow dr in getBundles.Tables[0].Rows)
{
courses[i, counter] = dr["bundleid"].ToString();
counter++;
}
string allID = "";
allID += courses[i, 0];
for (int ii = 0; ii < counter; ii++)
{
allID += "," + courses[i, ii];
}
Response.Write(allID + " <br/>");
coursestrings[i] = allID;
totalcourses[i] = counter;
}
GetUsers();
}
protected void GetUsers()
{
for (int i = 0; i < total - 1; i++)
{
SqlParameter[] objPara = new SqlParameter[10];
objPara[0] = new SqlParameter("@CompanyID", companies[i]);
objPara[1] = new SqlParameter("@CourseID", coursestrings[i]);
objPara[2] = new SqlParameter("@DateRangeType", 1);
//objPara[3] = new SqlParameter("@StartDate", startDate);
//objPara[4] = new SqlParameter("@EndDate", System.DateTime.Now.ToString("MM/dd/yyyy"));
objPara[5] = new SqlParameter("@UserName", "");
objPara[6] = new SqlParameter("@StartIndex", 1);
objPara[7] = new SqlParameter("@MaximumRows", 100000);
DataSet getData;
getData = SqlHelper.ExecuteDataset(ConfigurationManager.ConnectionStrings["connstr"].ConnectionString, CommandType.StoredProcedure, "Course_NewReportGet_Get_Sav", objPara);
foreach (DataRow dr in getData.Tables[0].Rows)
{
Response.Write("user: " + dr["userid"].ToString() + "/course: " + dr["bundleid"].ToString() + " - progress: " + dr["viewed"].ToString() + " - scored: " + dr["scored"].ToString() + "<br/><br/>");
}
}
}
}
페이지 코드 거대 :
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Optimus.aspx.cs" Inherits="admin_tools_Optimus" Debug="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="lblCurrentData" runat="server" Text="Click next to get all Companies"/><br />
<asp:Button ID="btnNext" runat="server" Text="Next" OnClick="Proceed" />
<br/>
<asp:ListBox ID="lstData" runat="server" height="300" Width="300" />
</div>
</form>
</body>
</html>
난 당신이 여기에 최종 결과로 달성하기 위해 노력하고 정확히 말할 수는 없지만, 대신 당신은 그것을 가지고 어떻게 데이터베이스에 왕복에서이 작업을 수행 할 수 있어야 것처럼 보인다. 그건 내가 생각할 수있는 시간을 너를 구해야한다. –
그래, 나는 똑같은 생각을하고 있었지만, 이렇게 작동하도록 만들 수 있다면 이것은 단 한 번의 데이터 변환이므로 훨씬 적은 노력을 기울일 것이다. – BigOmega