Skip Navigation LinksHome > Categories > Code from a Category

Save resized image and show it on asp.net website - part 1 of 2



User Name: jamest85
Name: James Tang
Contact Me: www.datawebcoder.com/ContactUs.aspx
Home Page: www.datawebcoder.com
Google Apps for Work Partner, Certified Zoho CRM Consultant. 7 years experience on Zoho consulting, implementation, and programming using C#, VB, Php..., 15 years of total IT experience including prog... [More]
Viewed Times: 3269
Add Date: 02/17/2010
This first part shows how to save an image to SQL server database by using asp.net FileUpload control.

Below shows a FileUpload control (with the "Browse..." button) and a "Add To List" button.


The Result will be shown in a gridview control:

1. In .aspx (or .ascx) page, add a FileUpload control, an Add to List button, a RegularExpressionValidator, and an error message label: 2. Code behind:
The function: getResizedPhoto() shows below: The function:insertImgForCode() 3. Stored Procedure in MS SQL 2005 The tblImg table looks like this:

Post a Comment

Name: (Optional)
Email: (Optional, you can get an email if somebody replys your comments)*
Email me if somebody respons my comment below:
Details**:
Enter Text
as Below:
(case insensitive, if hard to read, click the "get a new one" button)
 
    
* Your email address will not be shared with any third parties for any reason.
** Maximum 1000 charactors.