Click here to Skip to main content
15,895,656 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I am save all files(doc,image,pdf etc) into sql server as binary format using filestream,i mean file binary store table got filestream .When i try to select all row form table it show "System.OutOfMemoryException" ,how to solve this,how to increase memory space in sql server.

Note:i am going to generate png and js file form pdf file to view in web application using third party viewer.That third party viewer need png and js file,so at first other that pdf file i will convert other file to pdf and then form convert pdf file i will generate png and js file and store into another column.




Regards
Aravind
Posted
Updated 25-Dec-14 18:10pm
v2
Comments
DamithSL 25-Dec-14 23:39pm    
can explain your requirement? why you need to select all the files?
Aravindba 25-Dec-14 23:55pm    
Hi i am create windows service,in that it will generate png and js form pdf and again store png and js file as zip file in new column.So i am use third party tool to convert other than pdf file into pdf and then generate png and js file form converted pdf file,so i select all file at once and generate and store in sql server again,if already generated file i am not select,why i am generate png and js file pdf file,bcz i am going to view file in viewer using third party tool(that viewer need png and js file)
DamithSL 26-Dec-14 0:01am    
update the question with relevant code sample, then we can provide better solution.
if you are using windows service, how it trigger? is it detect new inserts or is it scheduled?
syed shanu 25-Dec-14 23:41pm    
Is this Windows or Web Application
Aravindba 26-Dec-14 0:00am    
hi pls read above reply ,and also i am view file in web using (online viewer) need png and js file,so when user open file in web application it take long time to generate png and js file,so i create windows service,so once user upload file may be open or not at the same time,so if open file in web application, i will generate png and js using web application(here only opened file generate png and js file so no problem here,bcz only one file i select),if not open then service generate png and js file and store into sql.

1 solution

rather than increasing sql server RAM you better change the application design. for example if you have thousands of files but user will view only one file at one time, so you you need to load all of them?
if you need to display list of files, select only other columns like below
SQL
select fileid, filename from yourtable

load only selected file
SQL
select fileData from yourtable where fileid =@fileid
by using where condition you can limit the results for matching files only
 
Share this answer
 
Comments
Aravindba 26-Dec-14 0:07am    
Yes,Thank u for ur reply,if user view file in web application ,that time i will select only view file,but user upload lot of files and may not view all file after upload,so that time i need to use service to generate png and js file and store it back in another column,so next time open generated png and js file then quickly view by user using viewer.
DamithSL 26-Dec-14 0:17am    
when you convert you can do it batch wise, for example run your convert service in every 10 minutes and pick only 10 files and do the processing, you change the frequency based on average number of new files inserted in given period of time
Aravindba 26-Dec-14 0:53am    
Thanks,Good idea ,i will try like 10 files,Thanks a lot

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900