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
satish kumar
NA
1
0
BitMap
Aug 6 2008 9:17 AM
Error: Parameter is not valid.
At line no 9 : of this below code
con.Open();
SqlCommand command1 = new SqlCommand("select imgfile from myimages where imgname=@param", con);
SqlParameter myparam = command1.Parameters.Add("@param", SqlDbType.NVarChar, 30);
myparam.Value = txtimgname.Text;
byte[] img = (byte[])command1.ExecuteScalar();
MemoryStream str = new MemoryStream();
string s1=str.Write(img, 0, img.Length);
Bitmap bit = new Bitmap(s1);
Response.ContentType = "image/jpeg";//or you can select your imagetype from database or directly write it here
bit.Save(Response.OutputStream, ImageFormat.Jpeg);
con.Close();
Reply
Answers (
1
)
Tab Format
How to enable users to paste images into a rich text editing control