Click here to Skip to main content
15,889,742 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: problem creating asp.net project in visual studio 2003 with xp pro Pin
bapu28892-May-10 3:06
bapu28892-May-10 3:06 
Questionuser group from active directory Pin
test-091-May-10 7:09
test-091-May-10 7:09 
AnswerRe: user group from active directory Pin
Abhijit Jana1-May-10 8:28
professionalAbhijit Jana1-May-10 8:28 
AnswerRe: user group from active directory Pin
Michel Godfroid1-May-10 22:18
Michel Godfroid1-May-10 22:18 
QuestionHow to access dynamically created Gridview HeaderRow Pin
KittyKit1-May-10 3:54
KittyKit1-May-10 3:54 
Questionsearch query Pin
diyaa_0830-Apr-10 23:50
diyaa_0830-Apr-10 23:50 
AnswerRe: search query Pin
Brij1-May-10 5:54
mentorBrij1-May-10 5:54 
Questionretreving images from database problem Pin
developerit30-Apr-10 22:51
developerit30-Apr-10 22:51 
hi iam using asp.net with c#

iam saving two images in database but while retreving only one image is displaying

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();

        }

    }


retreving code
================
protected void Page_Load(object sender, EventArgs e)
    {


        SqlCommand cmd = new SqlCommand("select imgc,imgo from images where Shop='Alsafa'", con);
        con.Open();
        SqlDataReader dr = cmd.ExecuteReader();
        if (dr.HasRows)
        {
            while (dr.Read())
            {

                
          
                Response.ContentType = "image/gif";
                Response.BinaryWrite((byte[])dr["imgc"]);
                
            Response.BinaryWrite((byte[])dr["imgo"]);



               
            }
        }




i want to display both the images from data base side by side but it is displaying only one image
AnswerRe: retreving images from database problem Pin
Abhishek Sur30-Apr-10 23:52
professionalAbhishek Sur30-Apr-10 23:52 
AnswerRe: retreving images from database problem Pin
Abhijit Jana30-Apr-10 23:53
professionalAbhijit Jana30-Apr-10 23:53 
QuestionGRID VIEW Row command Pin
Amit Patel198530-Apr-10 21:24
Amit Patel198530-Apr-10 21:24 
AnswerRe: GRID VIEW Row command Pin
Peace ON30-Apr-10 22:44
Peace ON30-Apr-10 22:44 
QuestionIntegrating Paypal Pin
Gjm30-Apr-10 15:29
Gjm30-Apr-10 15:29 
AnswerRe: Integrating Paypal Pin
Peace ON30-Apr-10 19:45
Peace ON30-Apr-10 19:45 
QuestionBinding Controls via Generic Method Pin
overtech0630-Apr-10 7:17
overtech0630-Apr-10 7:17 
AnswerRe: Binding Controls via Generic Method Pin
T M Gray30-Apr-10 7:57
T M Gray30-Apr-10 7:57 
GeneralRe: Binding Controls via Generic Method Pin
overtech0630-Apr-10 9:02
overtech0630-Apr-10 9:02 
AnswerRe: Binding Controls via Generic Method Pin
daveyerwin30-Apr-10 11:43
daveyerwin30-Apr-10 11:43 
GeneralRe: Binding Controls via Generic Method Pin
overtech0630-Apr-10 12:01
overtech0630-Apr-10 12:01 
GeneralRe: Binding Controls via Generic Method Pin
daveyerwin30-Apr-10 12:10
daveyerwin30-Apr-10 12:10 
GeneralRe: Binding Controls via Generic Method Pin
daveyerwin30-Apr-10 14:58
daveyerwin30-Apr-10 14:58 
AnswerReturn image from aspx page [modified] Pin
#realJSOP30-Apr-10 3:50
mve#realJSOP30-Apr-10 3:50 
GeneralRe: Return image from aspx page Pin
daveyerwin30-Apr-10 4:40
daveyerwin30-Apr-10 4:40 
GeneralRe: Return image from aspx page Pin
#realJSOP30-Apr-10 4:52
mve#realJSOP30-Apr-10 4:52 
GeneralRe: Return image from aspx page Pin
Abhishek Sur30-Apr-10 6:01
professionalAbhishek Sur30-Apr-10 6:01 

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.