arvinder_aneja wrote:i got the code but it only uploads images of the format jpg..
That is impossible. A web app uploads any file you like, through a control that doesn't care what sort of file it is dealing with. That's the only option in HTML, and therefore in ASP.NET.
Use the ASP.NET tag to let people know if you're writing a web app.
arvinder_aneja wrote:and also i want the code which would not allow to upload any duplicate image..
you can check if the same filename has been used, but you can't easily tell if two images are exactly the same image, that is, not without a bit of code and a bit of time for larger images.
arvinder_aneja wrote:moreover i will store that image name on database and when i would upload the image, i would like to show it on an image control
OK, that's easy
arvinder_aneja wrote:but because i am uploading only single image so i do not want to use any fully data bound controls like (Gridview,repeater or any other)..
To show images in a data bound control, you'd create a template for a column that shows an img tag, or an asp:Image tag, and binds the image path to the control. If you only want to show a single image, you'd just have a single img or asp:Image control, and bind that to the single path that you have to work with, there's literally no difference in the task, the only difference is adding a step to make it work with many images through a dataset.
Just to add, I appreciate you stating that you're writing a web app, and using real English to ask your question. Please just use the ASP.NET tag as well as C#, so that if people are filtering for questions to answer, they will find yours. It's really only for your benefit that I ask this.