Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to retrieve Image file from database with linq
C#
var pict = db.FUNC_GET_PERSON_IMAGE_BY_ID(Convert.ToInt32(id));


C#
var _PersonImages =db.PERSON_IMAGEs.Where(item=>item.PERSONIMAGE==(Convert.ToInt32(id)))


but error occurred timeout expired?
Posted
Comments
rahkan 31-Dec-12 13:04pm    
have you stepped through the code with the debugger? It should tell you what the error is when you use the debugger. One thing you might try, though, is to set a variable using the Convert.ToInt32(id) and use that variable in the linq statement. I can't remember right off hand if linq knows how to handles the Convert.ToInt32 or not
Yaseer Arafat 31-Dec-12 13:19pm    
I have user Convert.ToInt32(id) in several times .It only get trouble with byte[] type file
CHill60 31-Dec-12 13:53pm    
Can you amend your question to post the connection string you're using ... the image is probably quite large so you may need to increase the timeout on the connection
Yaseer Arafat 1-Jan-13 12:39pm    
Yes.These image are screenshot of Active window

Here is an article and sample code about using the Binary Class[^]: http://erikej.blogspot.hu/2009/11/how-to-save-and-retrieve-images-using.html[^].
 
Share this answer
 
Linq has (likely) nothing to do with the timeout error you are getting.

Please do a google search[^] to look how to increase the timeout (if required).
 
Share this answer
 

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