Click here to Skip to main content
15,910,603 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I want to display images that are present in the db to my asp page as page load event fires.I want to display images in the list-view,and I want to use linq queries to perform it.How Can I do It please Reply
Thank You.
Posted

I would write a method that's called from the PageLoad event handler. This method would query the database, retrive the necessary data, and then bind it to the appropriate control.
 
Share this answer
 
Comments
M Ali Qadir 7-Mar-12 10:18am    
would please elaborate more using codes so that I could better understand,please let me know that if i have add any handler for this also,If Yes then How should I code It to query db.thank you
#realJSOP 7-Mar-12 11:23am    
Google is your friend. I don't post code that I can't presonally test.
M Ali Qadir 7-Mar-12 12:04pm    
That's good sir could you please post some useful link for me to understand this process as I have Searched already, if I could find solution through google I may not come to codeproject.
M Ali Qadir 8-Mar-12 6:32am    
I have Found solution
C#
public void GetImage()
       {
           DataClasses2DataContext db=new DataClasses2DataContext();
           CheckInCheckOut1 chkInOut1 = new CheckInCheckOut1();

           var img = from c in db.CheckInCheckOut1s
                      select new
                      {
                          Name = c.Name,
                          ID = c.ID,
                          Image = c.ImageUrl,
                      };
           //ListView1.DataSource = img;
           lst1.DataBind();
 
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