Click here to Skip to main content
15,888,521 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Java script & IE 7 Pin
Brij29-Apr-10 0:41
mentorBrij29-Apr-10 0:41 
GeneralRe: Java script & IE 7 Pin
Arindam Tewary29-Apr-10 0:53
professionalArindam Tewary29-Apr-10 0:53 
GeneralRe: Java script & IE 7 Pin
Brij29-Apr-10 1:31
mentorBrij29-Apr-10 1:31 
AnswerRe: Java script & IE 7 Pin
Enobong Adahada29-Apr-10 2:28
Enobong Adahada29-Apr-10 2:28 
GeneralRe: Java script & IE 7 Pin
Jamil Hallal29-Apr-10 2:55
professionalJamil Hallal29-Apr-10 2:55 
GeneralRe: Java script & IE 7 Pin
Jamil Hallal29-Apr-10 2:58
professionalJamil Hallal29-Apr-10 2:58 
GeneralRe: Java script & IE 7 Pin
Enobong Adahada29-Apr-10 3:57
Enobong Adahada29-Apr-10 3:57 
Questionretreiving images from database and display as thumbnail images Pin
developerit28-Apr-10 22:41
developerit28-Apr-10 22:41 
hi, iam using asp.net with c#

i have table images

shop nvarchar(50),
imgc image
imgo image

iam saving images in a database but while retreving it is showing blank images. i want to display as thumb nail images ,

can you correct my code which helps me

saving code

protected void Button1_Click(object sender, EventArgs e)
   {


       if (FileUpload1.HasFile && FileUpload2.HasFile)
       {

           img1.ImageUrl = imgc.ImageUrl;
           img2.ImageUrl = imgo.ImageUrl;
           FileUpload1.SaveAs(MapPath("~/images/" + FileUpload1.FileName));
           imgc.ImageUrl = "~/images/" + FileUpload1.FileName;
           FileUpload2.SaveAs(MapPath("~/images/" + FileUpload2.FileName));
           imgo.ImageUrl = "~/images/" + FileUpload2.FileName;

           con.Open();

           SqlCommand cmd = new SqlCommand("Addimgproc",con);
           cmd.CommandType = CommandType.StoredProcedure;
           cmd.Parameters.AddWithValue("@Shop","Alsafa");
           FileInfo imageinfo = new FileInfo(FileUpload1.PostedFile.FileName.Trim());
           byte[] content = new byte[imageinfo.Length];
           FileStream imagestream = imageinfo.OpenRead();
           imagestream.Read(content,0,content.Length);
           imagestream.Close();
           //2nd upload
           FileInfo imageinfo1 = new FileInfo(FileUpload2.PostedFile.FileName.Trim());
           byte[] content1 = new byte[imageinfo1.Length];
           FileStream imagestream1 = imageinfo1.OpenRead();
           imagestream1.Read(content1, 0, content1.Length);
           imagestream1.Close();

           cmd.Parameters.AddWithValue("@imgc", content);
           cmd.Parameters.AddWithValue("@imgo",content1);
           cmd.ExecuteNonQuery();
           con.Close();

       }


       }


retreiving code
================

protected void Page_Load(object sender, EventArgs e)<br />
    {<br />
        SqlCommand cmd = new SqlCommand("select imgc,imgo from images where Shop='Alsafa'",con);<br />
       <br />
        con.Open();<br />
        <br />
        SqlDataReader dr = cmd.ExecuteReader();<br />
        if (dr.HasRows)<br />
        {<br />
<br />
            while (dr.Read())<br />
                <br />
            {<br />
                Image1.ImageUrl = dr["imgc"].ToString();<br />
                Image2.ImageUrl = dr["imgo"].ToString();<br />
            <br />
            }<br />
            dr.Close();<br />
        <br />
        }<br />
        con.Close();<br />
<br />
    }

AnswerRe: retreiving images from database and display as thumbnail images Pin
Arindam Tewary28-Apr-10 22:55
professionalArindam Tewary28-Apr-10 22:55 
AnswerRe: retreiving images from database and display as thumbnail images Pin
adkalavadia28-Apr-10 23:13
adkalavadia28-Apr-10 23:13 
QuestionProblem with datalist control (imagebutton) Pin
jitendrafaye28-Apr-10 22:26
jitendrafaye28-Apr-10 22:26 
AnswerRe: Problem with datalist control (imagebutton) Pin
Jamil Hallal28-Apr-10 22:47
professionalJamil Hallal28-Apr-10 22:47 
QuestionASP Architecture Question Pin
Paul Unsworth28-Apr-10 22:17
Paul Unsworth28-Apr-10 22:17 
AnswerRe: ASP Architecture Question Pin
Jamil Hallal28-Apr-10 22:24
professionalJamil Hallal28-Apr-10 22:24 
GeneralRe: ASP Architecture Question Pin
Paul Unsworth28-Apr-10 22:26
Paul Unsworth28-Apr-10 22:26 
GeneralRe: ASP Architecture Question Pin
Jamil Hallal28-Apr-10 22:37
professionalJamil Hallal28-Apr-10 22:37 
QuestionSplit String in ASP.NET with C#.NET Pin
cheguri28-Apr-10 21:42
cheguri28-Apr-10 21:42 
AnswerRe: Split String in ASP.NET with C#.NET Pin
Jamil Hallal28-Apr-10 21:45
professionalJamil Hallal28-Apr-10 21:45 
Questioni want to know how to use MSDN Pin
buffering8328-Apr-10 20:44
buffering8328-Apr-10 20:44 
AnswerRe: i want to know how to use MSDN Pin
Jamil Hallal28-Apr-10 21:08
professionalJamil Hallal28-Apr-10 21:08 
QuestionCss Issue Pin
siva45528-Apr-10 20:24
siva45528-Apr-10 20:24 
AnswerRe: Css Issue Pin
Jamil Hallal28-Apr-10 21:11
professionalJamil Hallal28-Apr-10 21:11 
GeneralRe: Css Issue [modified] Pin
siva45528-Apr-10 21:20
siva45528-Apr-10 21:20 
GeneralRe: Css Issue Pin
Jamil Hallal28-Apr-10 21:39
professionalJamil Hallal28-Apr-10 21:39 
AnswerRe: Css Issue Pin
Enobong Adahada29-Apr-10 4:41
Enobong Adahada29-Apr-10 4:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.