개발을 위해 Net Framework 4.0 및 Sql Server 2012를 사용하고 있습니다. asp.net의 웹 응용 프로그램에서 데이터베이스 작업을 수행하는 동안 임의로 오류가 발생합니다. 내가 파일 뒤에 코드에서 몇 가지 SQL 쿼리를 호출했습니다. 크기가 300KB를 초과하는 대용량 문서의 경우 발생합니다. 크기를 늘리는 방법.메모리 부족으로 인해. NET Framework 실행이 에스컬레이션 정책에 의해 중단되었습니다.
는 편집 :
그것은 주로보기 이미지 파일 동안 발생하는 데이터베이스 아래
에 바이너리 데이터를 저장한다 어떤 문제에 없다 내가 오류
int isUpdateIDProof = 1;
SqlParameter paramInsertIDProof = null;
SqlCommand cmdInsertIDProof = new SqlCommand("OnBoarding_InsertUploadedIDProof", con);
cmdInsertIDProof.CommandType = CommandType.StoredProcedure;
paramInsertIDProof = new SqlParameter("@FileCaption", SqlDbType.VarChar, 100);
paramInsertIDProof.Direction = ParameterDirection.Input;
paramInsertIDProof.Value = txtIDProofDescription.Text;
cmdInsertIDProof.Parameters.Add(paramInsertIDProof);
paramInsertIDProof = new SqlParameter("@FileData", SqlDbType.VarBinary,1000000000);
paramInsertIDProof.Direction = ParameterDirection.Input;
paramInsertIDProof.Value = OnBoardingFileData;
cmdInsertIDProof.Parameters.Add(paramInsertIDProof);
paramInsertIDProof = new SqlParameter("@FileNames", SqlDbType.VarChar, 100);
paramInsertIDProof.Direction = ParameterDirection.Input;
paramInsertIDProof.Value = fileName;
cmdInsertIDProof.Parameters.Add(paramInsertIDProof);
//execute SQL COMMAND
con.Open();
cmdInsertIDProof.ExecuteNonQuery();
con.Close();
몇 가지 코드를 게시 할 수 있습니까? 이의 가장 큰 원인은 다음 중 하나입니다 1) 이미지 파일 \ 이진 데이터가 실제로 너무 큰 2)가 제대로 여러 스레드 –
을 사이 SqlConnections \ SqlDataReader를 공유하고 있습니다 SqlConnections 3) \ 당신의 SqlDataReader를을 배치하지 않는 예 이 문제는 큰 크기의 문서에 발생합니다 –
저장 프로 시저에서 문제가있는 것으로 보입니다. 이것을 게시 할 수 있습니까? – Kitty