TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
nothing else
NA
28
32.1k
Response.BinaryWrite error by LINQ
Mar 2 2013 12:20 PM
I have used the ADO.NET which i don't want to use to save Image to Database, but when i use LINQ to save image, i'm get error.
here is my DB:
ImageHandler.ashx
public class ImageHandler : IHttpHandler {
ImageDataDataContext image = new ImageDataDataContext();
public void ProcessRequest (HttpContext context) {
string imageid = context.Request.QueryString["ImID"];
var ketqua = (from img in image.tblImgs
where img.imgID == int.Parse(imageid)
select new
{
img.imgData
}).First();
context.Response.BinaryWrite((byte[])ketqua); //
Cannot convert type 'AnonymousType#1' to 'byte[]'
context.Response.End();
}
public bool IsReusable {
get {
return false;
}
}
}
Can you pls help me how to correct the error. thanks :)
Reply
Answers (
5
)
Need to get the Row Count after execute a Stored Prodcedure
FirstOrDefault operator in LINQ