Click here to Skip to main content
13,548,809 members
Rate this:
Please Sign up or sign in to vote.
See more:
I want to retrieve Image file from database with linq
var pict = db.FUNC_GET_PERSON_IMAGE_BY_ID(Convert.ToInt32(id));

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

but error occurred timeout expired?
Posted 31-Dec-12 6:29am
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
emon-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
emon-arafat 1-Jan-13 12:39pm
Yes.These image are screenshot of Active window
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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).

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.180515.1 | Last Updated 31 Dec 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100