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
prisilla jayaraj
NA
35
102.5k
storing the image in database
Mar 10 2011 9:49 AM
FileUpload img = (FileUpload)FileUpload4;
Byte[] imgByte = null;
if (img.HasFile && img.PostedFile != null)
{
HttpPostedFile File = FileUpload4.PostedFile;
imgByte = new Byte[File.ContentLength];
File.InputStream.Read(imgByte, 0, File.ContentLength);
}
con.Open();
string sql = "INSERT INTO randomimage VALUES(@imgexplain,@imgtype)";
SqlCommand cmd1 = new SqlCommand(sql, con);
cmd1.Parameters.AddWithValue("@imgexplain", TextBox7.Text.Trim());
cmd1.Parameters.AddWithValue("@imgtype", imgByte);
int id = Convert.ToInt32(cmd1.ExecuteNonQuery());
Label17.Text = String.Format("Success to add");
this is the coding i using for storing the image ,when i display that how can i reduce the size of it?
plese tell me
Reply
Answers (
3
)
ERROR - Must Declare Scalar Variable - C#.net/SQL server 2005
Data in gridview from more than one table