Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# LINQ file
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
Comments
rahkan at 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 at 31-Dec-12 13:19pm
   
I have user Convert.ToInt32(id) in several times .It only get trouble with byte[] type file
CHill60 at 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 at 1-Jan-13 12:39pm
   
Yes.These image are screenshot of Active window
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Rate this: bad
good
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).
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 375
1 RyanDev 135
2 CHill60 120
3 Richard MacCutchan 115
4 Sergey Alexandrovich Kryukov 110


Advertise | Privacy | Mobile
Web01 | 2.8.140709.1 | Last Updated 31 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid