我正在使用Net framework 4.0和Sql Server 2012進行開發。在asp.net中的Web應用程序中執行數據庫操作時會隨機發生錯誤。我已經從代碼隱藏文件中調用了一些sql查詢。它發生在大於300KB的大文件上。如何增加大小。.net框架執行由於內存不足而被升級策略中止
編輯:
它主要發生時查看圖像文件和數據庫
下面保存二進制數據是在那裏我得到錯誤
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)你是不是正確處置您的SqlDataReaders \您共享SqlDataReaders \多線程 – 2013-05-14 18:26:43
之間SqlConnections SqlConnections 3)是對於大型文檔 – 2013-05-15 09:48:51
會出現此問題似乎是存儲過程中的問題。你可以發表這個。 – Kitty 2013-05-15 10:19:53